mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-27 13:32:45 +00:00
fflush: Split a temporary variable in two.
It is clearer to avoid reusing temporary variables for different purposes. Sponsored by: Klara, Inc. (cherry picked from commit1f90b4edff
) (cherry picked from commit1e99535be2
)
This commit is contained in:
parent
550f632c11
commit
ccdd8337f9
@ -104,10 +104,10 @@ int
|
|||||||
__sflush(FILE *fp)
|
__sflush(FILE *fp)
|
||||||
{
|
{
|
||||||
unsigned char *p, *old_p;
|
unsigned char *p, *old_p;
|
||||||
int n, t, old_w;
|
int n, f, t, old_w;
|
||||||
|
|
||||||
t = fp->_flags;
|
f = fp->_flags;
|
||||||
if ((t & __SWR) == 0)
|
if ((f & __SWR) == 0)
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
if ((p = fp->_bf._base) == NULL)
|
if ((p = fp->_bf._base) == NULL)
|
||||||
@ -122,7 +122,7 @@ __sflush(FILE *fp)
|
|||||||
old_p = fp->_p;
|
old_p = fp->_p;
|
||||||
fp->_p = p;
|
fp->_p = p;
|
||||||
old_w = fp->_w;
|
old_w = fp->_w;
|
||||||
fp->_w = t & (__SLBF|__SNBF) ? 0 : fp->_bf._size;
|
fp->_w = f & (__SLBF|__SNBF) ? 0 : fp->_bf._size;
|
||||||
|
|
||||||
for (; n > 0; n -= t, p += t) {
|
for (; n > 0; n -= t, p += t) {
|
||||||
t = _swrite(fp, (char *)p, n);
|
t = _swrite(fp, (char *)p, n);
|
||||||
|
Loading…
Reference in New Issue
Block a user