diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2012-12-18 12:54:10 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2012-12-18 12:54:10 +0400 |
commit | e3132dba5991af89a50cd695598ff0bd777c4b84 (patch) | |
tree | 1dfbbf7cfa9b6fdfb832bc248d3ac2b28f3c12c7 /newlib/libc | |
parent | 0a95d80385577a26d6bfcf431b86e7be6fae29e3 (diff) |
* libc/stdio/puts.c (_puts_r): Fix typo in previous patch. Add local
variable fp for better readability.
Diffstat (limited to 'newlib/libc')
-rw-r--r-- | newlib/libc/stdio/puts.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/newlib/libc/stdio/puts.c b/newlib/libc/stdio/puts.c index 0c6740a14..7b8b34b01 100644 --- a/newlib/libc/stdio/puts.c +++ b/newlib/libc/stdio/puts.c @@ -82,6 +82,7 @@ _DEFUN(_puts_r, (ptr, s), size_t c = strlen (s); struct __suio uio; struct __siov iov[2]; + FILE *fp; iov[0].iov_base = s; iov[0].iov_len = c; @@ -92,11 +93,11 @@ _DEFUN(_puts_r, (ptr, s), uio.uio_iovcnt = 2; _REENT_SMALL_CHECK_INIT (ptr); - - _newlib_flockfile_start (_stdout_r (ptr)); - ORIENT (_stdout_r (ptr), -1); - result = (__sfvwrite_r (ptr, _stdout_r (ptr), &uio) ? EOF : '\n'); - _newlib_flockfile_start (_stdout_r (ptr)); + fp = _stdout_r (ptr); + _newlib_flockfile_start (fp); + ORIENT (fp, -1); + result = (__sfvwrite_r (ptr, fp, &uio) ? EOF : '\n'); + _newlib_flockfile_end (fp); return result; } |