summaryrefslogtreecommitdiff
path: root/heynoti.c
diff options
context:
space:
mode:
Diffstat (limited to 'heynoti.c')
-rwxr-xr-xheynoti.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/heynoti.c b/heynoti.c
index 2d4b8cc..aed59d3 100755
--- a/heynoti.c
+++ b/heynoti.c
@@ -266,10 +266,12 @@ static int __handle_event(int fd)
return -1;
if (ie.len > 0u) {
- read(fd, name, (ie.len > FILENAME_MAX) ? (size_t)FILENAME_MAX : (size_t) ie.len);
+ r = read(fd, name, (ie.len > FILENAME_MAX) ? (size_t)FILENAME_MAX : (size_t) ie.len);
}
- r = read(fd, &ie, sizeof(ie));
+ if(r > 0) {
+ r = read(fd, &ie, sizeof(ie));
+ }
}
return 0;