about summary refs log tree commit diff
path: root/converter/ppm/ximtoppm.c
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2020-06-27 17:03:16 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2020-06-27 17:03:16 +0000
commit5d96d3c0c22088d20528fb0f0b126d175ec8a09f (patch)
treea2f504de6f6f9865e8e16d9a2a6f56fcb1c67945 /converter/ppm/ximtoppm.c
parent425de32af6e224afeabeda763c20ec944c3b029c (diff)
downloadnetpbm-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/ximtoppm.c')
-rw-r--r--converter/ppm/ximtoppm.c29
1 files changed, 3 insertions, 26 deletions
diff --git a/converter/ppm/ximtoppm.c b/converter/ppm/ximtoppm.c
index ce5e6396..dc04b363 100644
--- a/converter/ppm/ximtoppm.c
+++ b/converter/ppm/ximtoppm.c
@@ -116,32 +116,9 @@ ReadXimHeader(FILE *     const in_fp,
 */
     header->bits_channel = atoi(a_head.bits_per_channel);
     header->alpha_flag = atoi(a_head.alpha_channel);
-    if (strlen(a_head.author)) {
-        if (!(header->author = calloc((unsigned int)strlen(a_head.author)+1,
-                1))) {
-            pm_message("ReadXimHeader: can't calloc author string" );
-            return(0);
-        }
-    header->width = atoi(a_head.image_width);
-        strncpy(header->author, a_head.author, strlen(a_head.author));
-    }
-    if (strlen(a_head.date)) {
-        if (!(header->date =calloc((unsigned int)strlen(a_head.date)+1,1))){
-            pm_message("ReadXimHeader: can't calloc date string" );
-            return(0);
-        }
-    header->width = atoi(a_head.image_width);
-        strncpy(header->date, a_head.date, strlen(a_head.date));
-    }
-    if (strlen(a_head.program)) {
-        if (!(header->program = calloc(
-                    (unsigned int)strlen(a_head.program) + 1, 1))) {
-            pm_message("ReadXimHeader: can't calloc program string" );
-            return(0);
-        }
-    header->width = atoi(a_head.image_width);
-        strncpy(header->program, a_head.program,strlen(a_head.program));
-    }
+    pm_asprintf(&header->author,  a_head.author);
+    pm_asprintf(&header->date,    a_head.date);
+    pm_asprintf(&header->program, a_head.program);
     /* Do double checking for bakwards compatibility */
     if (header->npics == 0)
         header->npics = 1;