aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2012-12-18 08:54:10 +0000
committerCorinna Vinschen <corinna@vinschen.de>2012-12-18 08:54:10 +0000
commite3132dba5991af89a50cd695598ff0bd777c4b84 (patch)
tree1dfbbf7cfa9b6fdfb832bc248d3ac2b28f3c12c7 /newlib/libc
parent0a95d80385577a26d6bfcf431b86e7be6fae29e3 (diff)
downloadnewlib-e3132dba5991af89a50cd695598ff0bd777c4b84.zip
newlib-e3132dba5991af89a50cd695598ff0bd777c4b84.tar.gz
newlib-e3132dba5991af89a50cd695598ff0bd777c4b84.tar.bz2
* 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.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/newlib/libc/stdio/puts.c b/newlib/libc/stdio/puts.c
index 0c6740a..7b8b34b 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;
}