]> Savannah Git Hosting - gnulib.git/commitdiff
alloca, tsearch-tests: Write NULL for the null pointer.
authorMichal Privoznik <mprivozn@redhat.com>
Sun, 3 Mar 2019 18:34:57 +0000 (19:34 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 10 Mar 2019 03:40:23 +0000 (04:40 +0100)
* lib/alloca.c (i00afunc): Write NULL instead of 0.
* tests/test-tsearch.c (mangle_tree): Likewise.

ChangeLog
lib/alloca.c
tests/test-tsearch.c

index c1583dca58d90a667196dc3b30b3a3c25d1b7a27..bfb9ffc208caf9f1863a412f054cc4d5044badf7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-02-28  Michal Privoznik  <mprivozn@redhat.com>
+
+       alloca, tsearch-tests: Write NULL for the null pointer.
+       * lib/alloca.c (i00afunc): Write NULL instead of 0.
+       * tests/test-tsearch.c (mangle_tree): Likewise.
+
 2019-03-09  Bruno Haible  <bruno@clisp.org>
 
        strfmon_l: Fix -fsanitize=address finding.
index ee0f01886826ad9dcba250aad66fe7bc25c06213..d0476d53e6c756eca6158a07a49589df9aef0dee 100644 (file)
@@ -350,16 +350,16 @@ i00afunc (long *address)
   /* There must be at least one stack segment.  Therefore it is
      a fatal error if "trailer" is null.  */
 
-  if (trailer == 0)
+  if (trailer == NULL)
     abort ();
 
   /* Discard segments that do not contain our argument address.  */
 
-  while (trailer != 0)
+  while (trailer != NULL)
     {
       block = (long *) trailer->this_address;
       size = trailer->this_size;
-      if (block == 0 || size == 0)
+      if (block == NULL || size == 0)
         abort ();
       trailer = (struct stk_trailer *) trailer->link;
       if ((block <= address) && (address < (block + size)))
@@ -371,7 +371,7 @@ i00afunc (long *address)
 
   result = address - block;
 
-  if (trailer == 0)
+  if (trailer == NULL)
     {
       return result;
     }
@@ -383,7 +383,7 @@ i00afunc (long *address)
       result += trailer->this_size;
       trailer = (struct stk_trailer *) trailer->link;
     }
-  while (trailer != 0);
+  while (trailer != NULL);
 
   /* We are done.  Note that if you present a bogus address (one
      not in any segment), you will get a different number back, formed
index 808a82700369f6527e588f5ee8782f2ae088f672..2d0e794bbe688b6b6abce8a8964aec4977682fd9 100644 (file)
@@ -223,7 +223,7 @@ mangle_tree (enum order how, enum action what, void **root, int lag)
                   error = 1;
                 }
               elem = tsearch (x + j, root, cmp_fn);
-              if (elem == 0
+              if (elem == NULL
                   || tfind (x + j, (void *const *) root, cmp_fn) == NULL)
                 {
                   fputs ("Couldn't find element after it was added.\n",