don't allocate 0 bytes!
authorroot <devnull@localhost>
Fri, 16 Feb 1996 17:37:53 +0000 (17:37 +0000)
committerroot <devnull@localhost>
Fri, 16 Feb 1996 17:37:53 +0000 (17:37 +0000)
CVS patchset: 300
CVS date: 1996/02/16 17:37:53

build/pack.c

index bf9010b..70967a7 100644 (file)
@@ -834,8 +834,8 @@ int packageSource(Spec s)
 
     filelist = newStringBuf();
 
-    sources = malloc(s->numSources * sizeof(char *));
-    patches = malloc(s->numPatches * sizeof(char *));
+    sources = malloc((s->numSources+1) * sizeof(char *));
+    patches = malloc((s->numPatches+1) * sizeof(char *));
     
     /* Link in the spec file and all the sources */
     sprintf(dest, "%s%s", tempdir, strrchr(s->specfile, '/'));