Commit 79b35228 authored by Tomas Mraz's avatar Tomas Mraz Committed by Richard Levitte
Browse files

Do not eat trailing '\n' in BIO_gets for fd BIO.

parent 62f218cb
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -207,8 +207,10 @@ static int fd_gets(BIO *bp, char *buf, int size)
    char *ptr = buf;
    char *end = buf + size - 1;

    while ((ptr < end) && (fd_read(bp, ptr, 1) > 0) && (ptr[0] != '\n'))
        ptr++;
    while (ptr < end && fd_read(bp, ptr, 1) > 0) {
        if (*ptr++ == '\n')
           break;
    }

    ptr[0] = '\0';