"John V. Shahid" <[EMAIL PROTECTED]> writes:
> I think I found a bug in getline().
Nope. The bug is in your program (but I'll grant you -- it's an
obscure one).
Compile your code with -Wall, and you'll see this:
$ gcc -Wall junk3.c
junk3.c: In function 'main':
junk3.c:19: warning: implicit declaration of function 'getline'
junk3.c:7: warning: unused variable 'count'
The 'man getline' tells you to do this:
#define _GNU_SOURCE
Adding that to junk3.c, and compiling again with -Wall, tells you
the root of the problem:
junk3.c: In function 'main':
junk3.c:20: warning: passing argument 2 of 'getline' from incompatible pointer
type
Fixing that problem:
// int lineSize, count;
size_t lineSize;
cures the warning, cures your bug, and makes valgrind happy:
==28863== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 1)
Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
_______________________________________________
help-gplusplus mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gplusplus