update-copyright: generalize comment handling
[gnulib.git] / tests / test-memrchr.c
index f829a22..63568c1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 Free Software Foundation
+ * Copyright (C) 2008-2009 Free Software Foundation
  * Written by Eric Blake and Bruno Haible
  *
  * This program is free software: you can redistribute it and/or modify
@@ -22,6 +22,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#include "zerosize-ptr.h"
+
 #define ASSERT(expr) \
   do                                                                        \
     {                                                                       \
@@ -41,8 +43,6 @@
 int
 main ()
 {
-  void *nil = NULL; /* Use to avoid gcc attribute((nonnull)) warnings.  */
-
   size_t n = 0x100000;
   char *input = malloc (n);
   ASSERT (input);
@@ -58,7 +58,7 @@ main ()
   ASSERT (MEMRCHR (input, 'a', n) == input + n - 1);
 
   ASSERT (MEMRCHR (input, 'a', 0) == NULL);
-  ASSERT (MEMRCHR (nil, 'a', 0) == NULL);
+  ASSERT (MEMRCHR (zerosize_ptr (), 'a', 0) == NULL);
 
   ASSERT (MEMRCHR (input, 'b', n) == input + n - 2);
   ASSERT (MEMRCHR (input, 'c', n) == input + n - 3);