mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-21 18:27:22 +00:00
rtld snprintf: do not erronously skip a char at the buffer boundary
(cherry picked from commit 56ee5fc43c
)
This commit is contained in:
parent
cf2750be9e
commit
d9ec850bde
|
@ -81,11 +81,10 @@ snprintf_func(int ch, struct snprintf_arg *const info)
|
|||
}
|
||||
break;
|
||||
case PRINT_METHOD_WRITE:
|
||||
if (info->remain > 0) {
|
||||
*info->str++ = ch;
|
||||
info->remain--;
|
||||
} else
|
||||
if (info->remain == 0)
|
||||
printf_out(info);
|
||||
*info->str++ = ch;
|
||||
info->remain--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue