mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-03 16:21:06 +00:00
Tue Jul 25 09:14:53 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* stdio/vfprintf.c (vfprintf): For %s with precision spec, use memchr instead of strlen to limit search for NUL by precision.
This commit is contained in:
parent
51813e8065
commit
874f1b9bd8
@ -1,3 +1,8 @@
|
||||
Tue Jul 25 09:14:53 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* stdio/vfprintf.c (vfprintf): For %s with precision spec, use
|
||||
memchr instead of strlen to limit search for NUL by precision.
|
||||
|
||||
Mon Jul 24 03:13:16 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* sysdeps/posix/pathconf.c: New file.
|
||||
|
@ -531,13 +531,24 @@ vfprintf (s, format, ap)
|
||||
len = 0;
|
||||
}
|
||||
}
|
||||
else if (specs[cnt].info.prec != -1)
|
||||
{
|
||||
const char *end = memchr (str, '\0', specs[cnt].info.prec);
|
||||
if (end)
|
||||
len = end - str;
|
||||
else
|
||||
len = strlen (str);
|
||||
}
|
||||
else
|
||||
{
|
||||
len = strlen (str);
|
||||
|
||||
if (specs[cnt].info.prec != -1
|
||||
&& (size_t) specs[cnt].info.prec < len)
|
||||
/* Limit the length to the precision. */
|
||||
len = specs[cnt].info.prec;
|
||||
}
|
||||
|
||||
specs[cnt].info.width -= len;
|
||||
|
||||
if (!specs[cnt].info.left)
|
||||
|
Loading…
Reference in New Issue
Block a user