]> git.saurik.com Git - apple/libc.git/blob - stdio/FreeBSD/fputs.c.patch
Libc-391.tar.gz
[apple/libc.git] / stdio / FreeBSD / fputs.c.patch
1 --- fputs.c.orig Tue May 20 15:22:42 2003
2 +++ fputs.c Thu Jul 31 13:19:02 2003
3 @@ -48,6 +48,9 @@
4 #include "libc_private.h"
5 #include "local.h"
6
7 +// 3340719: __puts_null__ is used if string is NULL. Defined in puts.c
8 +__private_extern__ char const __puts_null__[];
9 +
10 /*
11 * Write the given string to the given file.
12 */
13 @@ -60,6 +63,9 @@
14 struct __suio uio;
15 struct __siov iov;
16
17 + // 3340719: __puts_null__ is used if s is NULL
18 + if(s == NULL)
19 + s = __puts_null__;
20 iov.iov_base = (void *)s;
21 iov.iov_len = uio.uio_resid = strlen(s);
22 uio.uio_iov = &iov;