summaryrefslogtreecommitdiffstats
path: root/src/pacman
diff options
context:
space:
mode:
Diffstat (limited to 'src/pacman')
-rw-r--r--src/pacman/ini.c2
-rw-r--r--src/pacman/util.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/pacman/ini.c b/src/pacman/ini.c
index 2a3ef0ed..2eb32302 100644
--- a/src/pacman/ini.c
+++ b/src/pacman/ini.c
@@ -66,7 +66,7 @@ static int _parse_ini(const char *file, ini_parser_fn cb, void *data,
goto cleanup;
}
- while(fgets(line, PATH_MAX, fp)) {
+ while(safe_fgets(line, PATH_MAX, fp)) {
char *key, *value, *ptr;
size_t line_len;
diff --git a/src/pacman/util.c b/src/pacman/util.c
index 6a095fdb..2671e54c 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -1403,7 +1403,7 @@ int multiselect_question(char *array, int count)
flush_term_input(fileno(stdin));
- if(fgets(response, response_len, stdin)) {
+ if(safe_fgets(response, response_len, stdin)) {
const size_t response_incr = 64;
size_t len;
/* handle buffer not being large enough to read full line case */
@@ -1416,7 +1416,7 @@ int multiselect_question(char *array, int count)
lastchar = response + response_len - 1;
/* sentinel byte */
*lastchar = 1;
- if(fgets(response + response_len - response_incr - 1,
+ if(safe_fgets(response + response_len - response_incr - 1,
response_incr + 1, stdin) == 0) {
free(response);
return -1;
@@ -1467,7 +1467,7 @@ int select_question(int count)
flush_term_input(fileno(stdin));
- if(fgets(response, sizeof(response), stdin)) {
+ if(safe_fgets(response, sizeof(response), stdin)) {
size_t len = strtrim(response);
if(len > 0) {
int n;
@@ -1521,7 +1521,7 @@ static int question(short preset, const char *format, va_list args)
flush_term_input(fd_in);
- if(fgets(response, sizeof(response), stdin)) {
+ if(safe_fgets(response, sizeof(response), stdin)) {
size_t len = strtrim(response);
if(len == 0) {
return preset;