commit 273f150c842e3daeb95f398ec29ed36c264e4ccf parent d6a9e35d0bafd692d2957d01f5068e3bef6e24fc Author: Connor Lane Smith <cls@lubutu.com> Date: Wed, 25 May 2011 20:45:01 +0100 fix afgets Diffstat:
M | util/afgets.c | | | 2 | +- |
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/util/afgets.c b/util/afgets.c @@ -20,5 +20,5 @@ afgets(char **p, size_t *size, FILE *fp) if(buf[n-1] == '\n' || feof(fp)) break; } - return *p; + return (len > 0) ? *p : NULL; }