Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.2
xosview
xosview-1.9.2-appdef.dif
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File xosview-1.9.2-appdef.dif of Package xosview
--- Xrm.cc +++ Xrm.cc 2012-02-07 16:45:31.561934420 +0000 @@ -9,6 +9,7 @@ #include <stdio.h> // For snprintf(). #include <ctype.h> #include <iostream> +#include <sys/stat.h> // For stat(). #include <unistd.h> // for access(), etc. BCG #include "snprintf.h" #include "general.h" @@ -140,29 +141,34 @@ Listed from weakest to strongest: // Merge in the system resource database. char rfilename[2048]; + struct stat st; int result; // Get the app-defaults + result = snprintf(rfilename, sizeof rfilename, "/usr/share/X11/app-defaults/%s", + XrmQuarkToString(_class)); + if (result >= 0 && (size_t)result < sizeof rfilename && stat(rfilename, &st) == 0) + XrmCombineFileDatabase (rfilename, &_db, 1); result = snprintf(rfilename, sizeof rfilename, "/etc/X11/app-defaults/%s", XrmQuarkToString(_class)); - if (rfilename != NULL) + if (result >= 0 && (size_t)result < sizeof rfilename && stat(rfilename, &st) == 0) XrmCombineFileDatabase (rfilename, &_db, 1); result = snprintf(rfilename, sizeof rfilename, "/usr/lib/X11/app-defaults/%s", XrmQuarkToString(_class)); - if (result >= 0 && result < sizeof rfilename) + if (result >= 0 && (size_t)result < sizeof rfilename && stat(rfilename, &st) == 0) XrmCombineFileDatabase (rfilename, &_db, 1); result = snprintf(rfilename, sizeof rfilename, "/usr/X11R6/lib/X11/app-defaults/%s", XrmQuarkToString(_class)); - if (result >= 0 && result < sizeof rfilename) + if (result >= 0 && (size_t)result < sizeof rfilename && stat(rfilename, &st) == 0) XrmCombineFileDatabase (rfilename, &_db, 1); // Try a few more, for SunOS/Solaris folks. result = snprintf(rfilename, sizeof rfilename, "/usr/openwin/lib/X11/app-defaults/%s", XrmQuarkToString(_class)); - if (result >= 0 && result < sizeof rfilename) + if (result >= 0 && (size_t)result < sizeof rfilename && stat(rfilename, &st) == 0) XrmCombineFileDatabase (rfilename, &_db, 1); result = snprintf(rfilename, sizeof rfilename, "/usr/local/X11R6/lib/X11/app-defaults/%s", XrmQuarkToString(_class)); - if (result >= 0 && result < sizeof rfilename) + if (result >= 0 && (size_t)result < sizeof rfilename && stat(rfilename, &st) == 0) XrmCombineFileDatabase (rfilename, &_db, 1); // Now, check for an XOSView file in the XAPPLRESDIR directory...
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