Coverity fix.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 29 Jan 2011 20:03:22 +0000 (20:03 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 29 Jan 2011 20:03:22 +0000 (20:03 +0000)
THerwig/THerwig6.cxx

index 4f522a9..bd2243e 100644 (file)
@@ -251,7 +251,7 @@ void THerwig6::InitializeJimmy(const char *beam, const char *target, double pbea
       printf("WARNING! In THerwig6:Initialize():\n");
       printf(" specified beam=%s is unrecognized .\n",beam);
       printf(" resetting to \"P\" .");
-      sprintf(cbeam,"P");
+      snprintf(cbeam, 8, "P");
    }
 
    if ( (!strncmp(target, "E+"    ,2)) &&
@@ -274,7 +274,7 @@ void THerwig6::InitializeJimmy(const char *beam, const char *target, double pbea
       printf("WARNING! In THerwig6:Initialize():\n");
       printf(" specified target=%s is unrecognized .\n",target);
       printf(" resetting to \"P\" .");
-      sprintf(ctarget,"P");
+      snprintf(ctarget, 8, "P");
    }
 
    // initialization: