about summary refs log tree commit diff
path: root/converter/ppm/ppmtompeg/specifics.c
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2020-06-27 17:06:12 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2020-06-27 17:06:12 +0000
commitc227dbc080d862b734f5f220345746fc8d8146bf (patch)
tree21e8e3574eeb5bba6b7fdba79cd9a97aa4b69ce2 /converter/ppm/ppmtompeg/specifics.c
parent4afa7625fa0819457809a2d54d99ef5ee5ed34e0 (diff)
downloadnetpbm-mirror-c227dbc080d862b734f5f220345746fc8d8146bf.tar.gz
netpbm-mirror-c227dbc080d862b734f5f220345746fc8d8146bf.tar.xz
netpbm-mirror-c227dbc080d862b734f5f220345746fc8d8146bf.zip
Release 10.86.15
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@3870 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/ppm/ppmtompeg/specifics.c')
-rw-r--r--converter/ppm/ppmtompeg/specifics.c35
1 files changed, 25 insertions, 10 deletions
diff --git a/converter/ppm/ppmtompeg/specifics.c b/converter/ppm/ppmtompeg/specifics.c
index 1a1fda44..a8a48af3 100644
--- a/converter/ppm/ppmtompeg/specifics.c
+++ b/converter/ppm/ppmtompeg/specifics.c
@@ -36,7 +36,12 @@
  * HEADER FILES *
  *==============*/
 
+#include <stdio.h>
+#include <string.h>
+
 #include "netpbm/mallocvar.h"
+#include "netpbm/nstring.h"
+
 #include "all.h"
 #include "mtypes.h"
 #include "frames.h"
@@ -44,8 +49,6 @@
 #include "fsize.h"
 #include "dct.h"
 #include "specifics.h"
-#include <stdio.h>
-#include <string.h>
 #include "prototypes.h"
 #include "param.h"
 
@@ -149,14 +152,21 @@ static char version = -1;
 void
 Specifics_Init() {
 
-    char command[1100];
     FILE *specificsFP;
   
-    sprintf(command, "rm -f %s.cpp", specificsFile);
-    system(command);
-    sprintf(command, "cpp -P %s %s %s.cpp",
-            specificsDefines, specificsFile, specificsFile);
-    system(command);
+    {
+        const char * command;
+        pm_asprintf(&command, "rm -f %s.cpp", specificsFile);
+        system(command);
+        pm_strfree(command);
+    }
+    {
+        const char * command;
+        pm_asprintf(&command, "cpp -P %s %s %s.cpp",
+                    specificsDefines, specificsFile, specificsFile);
+        system(command);
+        pm_strfree(command);
+    }
     strcat(specificsFile, ".cpp");
     if ((specificsFP = fopen(specificsFile, "r")) == NULL) {
         fprintf(stderr, "Error with specifics file, cannot open %s\n",
@@ -164,9 +174,14 @@ Specifics_Init() {
         exit(1);
     }
     printf("Specifics file: %s\n", specificsFile);
+
     Parse_Specifics_File(specificsFP);
-    sprintf(command, "rm -f %s.cpp", specificsFile);
-    system(command);
+    {
+        const char * command;
+        pm_asprintf(&command, "rm -f %s.cpp", specificsFile);
+        system(command);
+        pm_strfree(command);
+    }
 }