]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - THerwig/THerwig6.cxx
Coverity fix.
[u/mrichter/AliRoot.git] / THerwig / THerwig6.cxx
index f3760849d4396d23d22be3a24aa1107db111fcb4..bd2243e5c44798112a3cd726254503bc53ee0a69 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:
@@ -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: