dtcalc: Coverity (memory corruption, moderate)
authorJon Trulson <jon@radscan.com>
Fri, 26 Dec 2014 23:19:23 +0000 (16:19 -0700)
committerJon Trulson <jon@radscan.com>
Fri, 26 Dec 2014 23:19:23 +0000 (16:19 -0700)
cde/programs/dtcalc/ds_xlib.c

index d01238bb70445ca7129fc0306335dba7660c6e24..7626190736607a596ed8bc7c15341d679aaa246d 100644 (file)
@@ -178,7 +178,7 @@ ds_load_resources(Display *display)
 
   if ((ptr = getenv("DTCALCDEF")) == NULL)
     {
-      SPRINTF(name, "%s/.dtcalcdef", home) ;
+      snprintf(name, MAXPATHLEN - 1, "%s/.dtcalcdef", home) ;
       db = XrmGetFileDatabase(name) ;
     }
   else db = XrmGetFileDatabase(ptr) ;