avoid failed assertion with tight malloc
authorJim Meyering <meyering@redhat.com>
Sat, 3 May 2008 10:51:08 +0000 (12:51 +0200)
committerJim Meyering <meyering@redhat.com>
Sat, 3 May 2008 10:52:37 +0000 (12:52 +0200)
* tests/test-getndelim2.c: Correct an off-by-one assertion.

ChangeLog
tests/test-getndelim2.c

index f566efa..ec7d295 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-05-03  Jim Meyering  <meyering@redhat.com>
+
+       avoid failed assertion with tight malloc
+       * tests/test-getndelim2.c: Correct an off-by-one assertion.
+
 2008-05-03  Simon Josefsson  <simon@josefsson.org>
 
        * m4/inet_pton.m4: Set HAVE_DECL_INET_PTON to 0 when declarations
index 10ec1d8..d1eb12a 100644 (file)
@@ -138,7 +138,7 @@ main (int argc, char **argv)
 
     result = getndelim2 (&line, &len, 0, GETNLINE_NO_LIMIT, 'g', 'f', f);
     ASSERT (result == 501 * 14 - 1);
-    ASSERT (501 * 14 < len);
+    ASSERT (501 * 14 <= len);
     buffer[499] = 'f';
     buffer[500] = '\0';
     ASSERT (strcmp (buffer, line + 501 * 13) == 0);