summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
821f3da)
unsigned char. This differentiates them from EOF and matches
the behavior prior to the recent m_getfld() rework. But that
behavior is very broken on 8-bit input.
+/* The return values of the following functions are a bit
+ subtle. They can return 0x00 - 0xff as a valid character,
+ but EOF is typically 0xffffffff. */
static int
Getc (m_getfld_state_t s) {
if (s->end - s->readpos < 1) {
static int
Getc (m_getfld_state_t s) {
if (s->end - s->readpos < 1) {
- return s->readpos < s->end ? *s->readpos++ : EOF;
+ return s->readpos < s->end ? (unsigned char) *s->readpos++ : EOF;
- return s->readpos < s->end ? *s->readpos : EOF;
+ return s->readpos < s->end ? (unsigned char) *s->readpos : EOF;
return EOF;
} else {
--s->bytes_read;
return EOF;
} else {
--s->bytes_read;
- return *--s->readpos = c;
+ return *--s->readpos = (unsigned char) c;