[hackers] [sbase] Return number of bytes read even on a partial read || FRIGN

From: <git_AT_suckless.org>
Date: Tue, 24 Mar 2015 23:53:33 +0100 (CET)

commit 696bb992c3b3f5536c3c204c3e7130832fdce0e6
Author: FRIGN <dev_AT_frign.de>
Date: Sun Feb 1 03:54:56 2015 +0100

    Return number of bytes read even on a partial read
    
    and set the rune to Runeerror for later checking (if desired).

diff --git a/libutf/readrune.c b/libutf/readrune.c
index 8fd003b..8bab478 100644
--- a/libutf/readrune.c
+++ b/libutf/readrune.c
_AT_@ -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)) {
Received on Tue Mar 24 2015 - 23:53:33 CET

This archive was generated by hypermail 2.3.0 : Wed Mar 25 2015 - 00:07:43 CET