Coverity fixes.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 29 Jan 2011 18:27:16 +0000 (18:27 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 29 Jan 2011 18:27:16 +0000 (18:27 +0000)
THerwig/THerwig6.cxx

index f376084..4f522a9 100644 (file)
@@ -168,7 +168,7 @@ void THerwig6::Initialize(const char *beam, const char *target, double pbeam1, d
       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)) &&
@@ -191,7 +191,7 @@ void THerwig6::Initialize(const char *beam, const char *target, double pbeam1, d
       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: