1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
--- Xrm.cc.orig Fri May 29 04:34:30 1998
+++ Xrm.cc Fri May 29 04:39:30 1998
@@ -156,7 +156,7 @@
if (xappdir != NULL)
{
char xappfile[1024];
- sprintf (xappfile, "%s/%s", xappdir, className());
+ snprintf (xappfile, 1024, "%s/%s", xappdir, className());
// this did not work for XAPPLRESDIR
//if (!access (xappfile, X_OK | R_OK))
if (!access (xappfile, R_OK))
@@ -185,8 +185,10 @@
// Now, check for a user resource file, and merge it in if there is one...
if ( getenv( "HOME" ) != NULL ){
char userrfilename[1024];
- strcpy(userrfilename, getenv("HOME"));
- strcat(userrfilename, "/.Xdefaults");
+#define XDEFAULTS "/.Xdefaults"
+ strncpy(userrfilename, getenv("HOME"), 1024-strlen(XDEFAULTS));
+ strcat(userrfilename, XDEFAULTS);
+#undef XDEFAULTS
// User file overrides system (_db).
XrmCombineFileDatabase (userrfilename, &_db, 1);
}
|