about summary refs log tree commit diff
path: root/converter/ppm/ppmtompeg/param.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/param.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/param.c')
-rw-r--r--converter/ppm/ppmtompeg/param.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/converter/ppm/ppmtompeg/param.c b/converter/ppm/ppmtompeg/param.c
index 87fdfa6b..ce2cadf1 100644
--- a/converter/ppm/ppmtompeg/param.c
+++ b/converter/ppm/ppmtompeg/param.c
@@ -312,13 +312,13 @@ expandBackTickLine(const char *         const input,
                    struct inputSource * const inputSourceP) {
 
     FILE *fp;
-    char cmd[300];
+    const char * cmd;
     const char * start;
     const char * end;
-    char cdcmd[110];
+    const char * cdcmd;
 
     start = &input[1];
-    end = &input[strlen(input)-1];
+    end   = &input[strlen(input)-1];
 
     while (*end != '`') {
         end--;
@@ -327,14 +327,14 @@ expandBackTickLine(const char *         const input,
     end--;
 
     if (optionSeen[OPTION_INPUT_DIR])
-        sprintf(cdcmd,"cd %s;",currentPath);
+        pm_asprintf(&cdcmd,"cd %s;", currentPath);
     else
-        strcpy(cdcmd,"");
+        cdcmd = pm_strdup("");
 
     {
         char tmp[300];
         strncpy(tmp,start,end-start+1);
-        sprintf(cmd,"(%s %s)", cdcmd, tmp);
+        pm_asprintf(&cmd, "(%s %s)", cdcmd, tmp);
     }
 
     fp = popen(cmd, "r");
@@ -348,6 +348,8 @@ expandBackTickLine(const char *         const input,
 
         mergeInputSource(inputSourceP, &subInputSource);
     }
+    pm_strfree(cmd);
+    pm_strfree(cdcmd);
 }