diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2020-06-27 17:03:16 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2020-06-27 17:03:16 +0000 |
commit | 5d96d3c0c22088d20528fb0f0b126d175ec8a09f (patch) | |
tree | a2f504de6f6f9865e8e16d9a2a6f56fcb1c67945 /converter/ppm/ppmtompeg/specifics.c | |
parent | 425de32af6e224afeabeda763c20ec944c3b029c (diff) | |
download | netpbm-mirror-5d96d3c0c22088d20528fb0f0b126d175ec8a09f.tar.gz netpbm-mirror-5d96d3c0c22088d20528fb0f0b126d175ec8a09f.tar.xz netpbm-mirror-5d96d3c0c22088d20528fb0f0b126d175ec8a09f.zip |
Release 10.73.32
git-svn-id: http://svn.code.sf.net/p/netpbm/code/super_stable@3869 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/ppm/ppmtompeg/specifics.c')
-rw-r--r-- | converter/ppm/ppmtompeg/specifics.c | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/converter/ppm/ppmtompeg/specifics.c b/converter/ppm/ppmtompeg/specifics.c index fb5e3649..59bd3473 100644 --- a/converter/ppm/ppmtompeg/specifics.c +++ b/converter/ppm/ppmtompeg/specifics.c @@ -36,6 +36,8 @@ * HEADER FILES * *==============*/ +#include "netpbm/nstring.h" + #include "all.h" #include "mtypes.h" #include "frames.h" @@ -43,8 +45,6 @@ #include "fsize.h" #include "dct.h" #include "specifics.h" -#include <stdio.h> -#include <string.h> #include "prototypes.h" #include "param.h" @@ -148,14 +148,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", @@ -163,9 +170,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); + } } |