diff options
Diffstat (limited to 'gl/tests/test-getline.c')
-rw-r--r-- | gl/tests/test-getline.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gl/tests/test-getline.c b/gl/tests/test-getline.c index 238742cf0f..13dcb1d7f8 100644 --- a/gl/tests/test-getline.c +++ b/gl/tests/test-getline.c @@ -1,5 +1,5 @@ /* Test of getline() function. - Copyright (C) 2007-2015 Free Software Foundation, Inc. + Copyright (C) 2007-2016 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -71,8 +71,8 @@ main (void) free (line); /* Test growth of buffer, must not leak. */ - line = malloc (1); - len = 0; + len = 1; + line = malloc (len); result = getline (&line, &len, f); ASSERT (result == 3); ASSERT (strcmp (line, "bc\n") == 0); |