aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarstr\xf6m <john@ankarstrom.se>2021-05-31 20:46:40 +0200
committerJohn Ankarstr\xf6m <john@ankarstrom.se>2021-05-31 20:46:40 +0200
commit8cc2b45caabc4d15d15193acdeda90246e5f3aba (patch)
treecbe494af699e97f93b90d54d79f2a98dad2d401b
parentdebd03fa7cd6c133e61b89ba0ae48d9136055d77 (diff)
downloadsafetitle-8cc2b45caabc4d15d15193acdeda90246e5f3aba.tar.gz
Fix read error check
-rw-r--r--safetitle.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/safetitle.c b/safetitle.c
index ee2a205..a926264 100644
--- a/safetitle.c
+++ b/safetitle.c
@@ -41,8 +41,8 @@ da(int fd, char *buf, int real)
read:
while(r = read(fd, &c, 1)){
- if(!r){
- fprintf(stderr, "bad terminal\n");
+ if(r==-1){
+ warn("read");
return -1;
}
buf[i++] = c;