=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ftp/fetch.c,v retrieving revision 1.144 retrieving revision 1.145 diff -c -r1.144 -r1.145 *** src/usr.bin/ftp/fetch.c 2016/01/08 20:36:01 1.144 --- src/usr.bin/ftp/fetch.c 2016/01/28 21:31:50 1.145 *************** *** 1,4 **** ! /* $OpenBSD: fetch.c,v 1.144 2016/01/08 20:36:01 sthen Exp $ */ /* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */ /*- --- 1,4 ---- ! /* $OpenBSD: fetch.c,v 1.145 2016/01/28 21:31:50 martijn Exp $ */ /* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */ /*- *************** *** 1557,1564 **** errx(1, "SSL read error: %s", tls_error(tls)); buf[i] = c; ! if (c == '\n') break; } *lenp = i; return (buf); --- 1557,1566 ---- errx(1, "SSL read error: %s", tls_error(tls)); buf[i] = c; ! if (c == '\n') { ! buf[i] = '\0'; break; + } } *lenp = i; return (buf);