Return number of bytes read even on a partial read

and set the rune to Runeerror for later checking (if desired).
This commit is contained in:
FRIGN 2015-02-01 03:54:56 +01:00
parent f2e6af7350
commit 696bb992c3

View File

@ -34,7 +34,8 @@ readrune(const char *file, FILE *fp, Rune *r)
file, strerror(errno));
exit(1);
}
return 0;
*r = Runeerror;
return i;
}
buf[i++] = c;
if (fullrune(buf, i)) {