From 4281a1a7f2d24cfcf0997122cc75c216a17f3e5b Mon Sep 17 00:00:00 2001 From: Laszlo Papp Date: Sat, 17 Oct 2009 23:12:19 +0200 Subject: Size handling was changed in fgets() functions Pacman's fgets function in the API used hardcoded numbers to identify the size. This is not good practice, so replace them with sizeof handling. Signed-off-by: Laszlo Papp Signed-off-by: Dan McGee --- lib/libalpm/trans.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/libalpm/trans.c') diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c index 65bd4642..aea71db1 100644 --- a/lib/libalpm/trans.c +++ b/lib/libalpm/trans.c @@ -320,7 +320,8 @@ static int grep(const char *fn, const char *needle) } while(!feof(fp)) { char line[1024]; - fgets(line, 1024, fp); + int sline = sizeof(line)-1; + fgets(line, sline, fp); if(feof(fp)) { continue; } -- cgit v1.2.3-54-g00ecf