diff options
author | Laszlo Papp <djszapi@archlinux.us> | 2009-10-17 23:12:19 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2009-10-19 07:37:53 -0500 |
commit | 4281a1a7f2d24cfcf0997122cc75c216a17f3e5b (patch) | |
tree | 3d752f02c3c1ad8189c911fab0c2e84ad9fdcce2 /lib/libalpm/trans.c | |
parent | f9582c7df223e1eb4078e6db4e2d35dc0f2bf9be (diff) | |
download | pacman-4281a1a7f2d24cfcf0997122cc75c216a17f3e5b.tar.xz |
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 <djszapi@archlinux.us>
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/trans.c')
-rw-r--r-- | lib/libalpm/trans.c | 3 |
1 files changed, 2 insertions, 1 deletions
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; } |