winetest: Avoid an infinite loop in vstrfmtmake() when the format is NULL.
When the format is NULL vsnprintf() always returns -1 so we keep doubling the allocated memory until running out of memory.
This commit is contained in:
parent
b07129bad4
commit
cac02872c6
1 changed files with 1 additions and 0 deletions
|
@ -56,6 +56,7 @@ static char *vstrfmtmake (size_t *lenp, const char *fmt, va_list ap)
|
|||
char *p;
|
||||
int n;
|
||||
|
||||
if (!fmt) fmt = "";
|
||||
p = xalloc(size);
|
||||
while (1) {
|
||||
n = vsnprintf (p, size, fmt, ap);
|
||||
|
|
Loading…
Add table
Reference in a new issue