aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-07-12 12:00:55 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-07-12 12:00:55 +0200
commit059f5b13acf3774b279125b3b568b55e13680ac6 (patch)
tree50b5b432165a8a310709596615405f053efc105c
parent1fae647e7924b96aea930ff56345ed9fa8d29a1e (diff)
downloadre-name-059f5b13acf3774b279125b3b568b55e13680ac6.tar.gz
re.c: Use fgets
-rw-r--r--re.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/re.c b/re.c
index 442baf7..f4aeca8 100644
--- a/re.c
+++ b/re.c
@@ -30,7 +30,7 @@ main(int argc, char *argv[])
if(!access(file, F_OK)){
do
fprintf(stderr, "%s already exists; overwrite? ", file);
- while(!gets(ans) || !*ans);
+ while(!fgets(ans, 10, stdin) || ans[0] == '\n');
if(ans[0] != 'y') return 1;
}