diff options
author | John Ankarstr\xf6m <john@ankarstrom.se> | 2021-05-31 20:46:40 +0200 |
---|---|---|
committer | John Ankarstr\xf6m <john@ankarstrom.se> | 2021-05-31 20:46:40 +0200 |
commit | 8cc2b45caabc4d15d15193acdeda90246e5f3aba (patch) | |
tree | cbe494af699e97f93b90d54d79f2a98dad2d401b | |
parent | debd03fa7cd6c133e61b89ba0ae48d9136055d77 (diff) | |
download | safetitle-8cc2b45caabc4d15d15193acdeda90246e5f3aba.tar.gz |
Fix read error check
-rw-r--r-- | safetitle.c | 4 |
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; |