Brandon Casey wrote: > Be aware that if we use the version I suggested which pushes the '\r' back > into the input stream, I think we risk an infinite loop if size == 1. I don't > think that is possible from the current callers though. I think something like this would avoid any potential infinite loop, however improbable: if (c == '\n') { if (len > 1 && buf[len - 2] == '\r') buf[--len - 1] = '\n'; } else if (c == '\r') { c = getc(in); if (c == '\n') buf[len - 1] = '\n'; else if (c != EOF) ungetc(c, in); } -brandon -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html