From aa459ef443c756c28ce883fdd7f15c98fcefc7dc Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 13 Aug 2017 10:55:55 -0700 Subject: reallocarray: minor fixes * doc/glibc-functions/reallocarray.texi: Update version numbers. * m4/reallocarray.m4 (gl_FUNC_REALLOCARRAY): Don't trust _cv_ contents. * modules/reallocarray (License): Change from GPL to LGPL. * tests/test-reallocarray.c (main): Fix ENOMEM typo. Indent properly and don't use tabs. --- tests/test-reallocarray.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'tests/test-reallocarray.c') diff --git a/tests/test-reallocarray.c b/tests/test-reallocarray.c index 587c700015..f91ede70a3 100644 --- a/tests/test-reallocarray.c +++ b/tests/test-reallocarray.c @@ -26,16 +26,18 @@ int main () { size_t n; - /* Check that reallocarray fails when requested to allocate a block of memory - larger than SIZE_MAX bytes. */ + + /* Check that reallocarray fails when requested to allocate a block + of memory larger than SIZE_MAX bytes. */ for (n = 2; n != 0; n <<= 1) - { - if (reallocarray (NULL, (size_t) -1 / n + 1, n)) - return 1; - - /* Ensure that errno is correctly set */ - if (!errno == ENOMEM) - return 1; - } + { + if (reallocarray (NULL, (size_t) -1 / n + 1, n)) + return 1; + + /* Ensure that errno is correctly set. */ + if (errno != ENOMEM) + return 1; + } + return 0; } -- cgit v1.2.1