summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaszlo Papp <djszapi@archlinux.us>2009-10-17 23:12:19 +0200
committerDan McGee <dan@archlinux.org>2009-10-19 07:37:53 -0500
commit4281a1a7f2d24cfcf0997122cc75c216a17f3e5b (patch)
tree3d752f02c3c1ad8189c911fab0c2e84ad9fdcce2 /src
parentf9582c7df223e1eb4078e6db4e2d35dc0f2bf9be (diff)
downloadpacman-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 'src')
-rw-r--r--src/pacman/util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pacman/util.c b/src/pacman/util.c
index 0e5e7f5c..1143befd 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -580,6 +580,7 @@ void display_optdepends(pmpkg_t *pkg)
static int question(short preset, char *fmt, va_list args)
{
char response[32];
+ int sresponse = sizeof(response)-1;
FILE *stream;
if(config->noconfirm) {
@@ -602,7 +603,7 @@ static int question(short preset, char *fmt, va_list args)
return(preset);
}
- if(fgets(response, 32, stdin)) {
+ if(fgets(response, sresponse, stdin)) {
strtrim(response);
if(strlen(response) == 0) {
return(preset);