ralloc: Set *start in ralloc_vasprintf_rewrite_tail() if str is NULL.

We were leaving it undefined, even though we were writing a string to
*str.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Matt Turner
2015-06-29 15:05:19 -07:00
parent 903050694b
commit 238877207e

View File

@@ -499,6 +499,7 @@ ralloc_vasprintf_rewrite_tail(char **str, size_t *start, const char *fmt,
if (unlikely(*str == NULL)) { if (unlikely(*str == NULL)) {
// Assuming a NULL context is probably bad, but it's expected behavior. // Assuming a NULL context is probably bad, but it's expected behavior.
*str = ralloc_vasprintf(NULL, fmt, args); *str = ralloc_vasprintf(NULL, fmt, args);
*start = strlen(*str);
return true; return true;
} }