-/* If there's room, put non-EOF c back into msg_buf and rewind so it's
- * read next. c need not be the value already in the buffer. If there
- * isn't room then return EOF, else return c. */
-static int
-Ungetc (int c, m_getfld_state_t s) {
- if (s->readpos == s->msg_buf) {
- return EOF;
- }
- --s->bytes_read;
- return *--s->readpos = (unsigned char) c;
+/* If there's room, undo the consumption of one character from msg_buf,
+ * rewinding so it's read next, else die. */
+static void
+Ungetc(m_getfld_state_t s)
+{
+ if (s->readpos == s->msg_buf)
+ die("Ungetc() at start of message buffer.");
+
+ s->readpos--;
+ s->bytes_read--;