From 696bb992c3b3f5536c3c204c3e7130832fdce0e6 Mon Sep 17 00:00:00 2001 From: FRIGN Date: Sun, 1 Feb 2015 03:54:56 +0100 Subject: [PATCH] Return number of bytes read even on a partial read and set the rune to Runeerror for later checking (if desired). --- libutf/readrune.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libutf/readrune.c b/libutf/readrune.c index 8fd003b..8bab478 100644 --- a/libutf/readrune.c +++ b/libutf/readrune.c @@ -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)) {