]> git.ipfire.org Git - thirdparty/tar.git/commitdiff
Port xsparse.c to AIX
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 6 Nov 2024 18:05:23 +0000 (10:05 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 6 Nov 2024 18:18:55 +0000 (10:18 -0800)
* scripts/xsparse.c (emalloc): Do not report failure when malloc
(0) returns NULL, as it does on AIX.  Simply return a null
pointer; that’s good enough for xsparse.c.

scripts/xsparse.c

index 8559d10593b4824c5ef30e7b9f2d8555dd98df64..4632e9ea4a401b80a45be6769413277b34970829 100644 (file)
@@ -65,7 +65,7 @@ static void *
 emalloc (size_t size)
 {
   char *p = malloc (size);
-  if (!p)
+  if (!p && size)
     die (1, "not enough memory");
   return p;
 }