It looks like the guess_len function in our local printf.c has some questionable code in it. Now that we are checking in configure for vsnprintf, take advantage of that check to use the far simpler method if it is available. Given that we no longer support such ancient systems where this might not be available, one suspects the other questionable code may no longer be required - but set that aside for another day.
Этот коммит содержится в:
родитель
bffb2b7a4b
Коммит
c52601f0c5
@ -48,6 +48,13 @@ static int guess_strlen(const char *fmt, va_list ap)
|
||||
int len;
|
||||
long larg;
|
||||
|
||||
#if HAVE_VSNPRINTF
|
||||
{
|
||||
char dummy[1];
|
||||
return 1 + vsnprintf(dummy, sizeof(dummy), fmt, ap);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Start off with a fudge factor of 128 to handle the % escapes that
|
||||
we aren't calculating here */
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user