summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <programble@gmail.com>2016-09-12 19:51:31 -0400
committerJune McEnroe <programble@gmail.com>2016-09-12 19:51:31 -0400
commit7b6e164883c1de663e0611dab96998abd93f9467 (patch)
tree146bc26430d096c87b474d35219d313f8da72362
parentRewrite xx.c (diff)
downloadsrc-7b6e164883c1de663e0611dab96998abd93f9467.tar.gz
src-7b6e164883c1de663e0611dab96998abd93f9467.zip
Prevent offset from xx when reading zero
Diffstat (limited to '')
-rwxr-xr-x.bin/xx.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/.bin/xx.c b/.bin/xx.c
index 733a1bda..7ffadd7f 100755
--- a/.bin/xx.c
+++ b/.bin/xx.c
@@ -58,6 +58,7 @@ int main(int argc, char **argv) {
     for (;;) {
         offset += len;
         len = fread(buf, 1, sizeof(buf), file);
+        if (!len) break;
 
         if ((flags & FLAG_SKIP) && len == sizeof(buf)) {
             static bool skip = false;