Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12:GA
yudit
uniprint-catch-bad_alloc-exceptions.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File uniprint-catch-bad_alloc-exceptions.patch of Package yudit
Index: yudit-2.9.2/uniprint/Main.cpp =================================================================== --- yudit-2.9.2.orig/uniprint/Main.cpp +++ yudit-2.9.2/uniprint/Main.cpp @@ -37,6 +37,8 @@ #include <string.h> #include <stdlib.h> +#include <new> + #define BUFFER_SIZE 512 static const char *version="uniprint verison %s GNU(c) Gaspar Sinai\n"; @@ -318,11 +320,20 @@ main (int argc, char *argv[]) uniPrint.setLineEndMark(shownl); uniPrint.setWordWrap(wrap); - if (!uniPrint.print (ifileString, utf8.encode (res))) + try { - fprintf (stderr, "uniprint: can not print.\n"); + if (!uniPrint.print (ifileString, utf8.encode (res))) + { + fprintf (stderr, "uniprint: can not print.\n"); + return 1; + } + } + catch (std::bad_alloc) + { + fprintf (stderr, "uniprint: can not print (out of memory).\n"); return 1; } + int pagecount = uniPrint.getPageCount(); if (pagecount > 1) {
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor