aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/ralloc.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-02-29 13:47:34 +0100
committermarha <marha@users.sourceforge.net>2012-02-29 13:47:34 +0100
commitc14f2432d6bfb3de6c6289efd0471f038a289327 (patch)
tree8864ad1e5d0ae65dd665aa45245f2dab86c3f178 /mesalib/src/glsl/ralloc.c
parent8475e285d0146b123f0ac1a87294c42088af12b0 (diff)
parent15a500d3edb03668b43cc6898fafcda024d0f006 (diff)
downloadvcxsrv-c14f2432d6bfb3de6c6289efd0471f038a289327.tar.gz
vcxsrv-c14f2432d6bfb3de6c6289efd0471f038a289327.tar.bz2
vcxsrv-c14f2432d6bfb3de6c6289efd0471f038a289327.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/glsl/ralloc.c')
-rw-r--r--mesalib/src/glsl/ralloc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/mesalib/src/glsl/ralloc.c b/mesalib/src/glsl/ralloc.c
index 91e4bab2e..2f93dcdea 100644
--- a/mesalib/src/glsl/ralloc.c
+++ b/mesalib/src/glsl/ralloc.c
@@ -448,11 +448,11 @@ ralloc_vasprintf_append(char **str, const char *fmt, va_list args)
size_t existing_length;
assert(str != NULL);
existing_length = *str ? strlen(*str) : 0;
- return ralloc_vasprintf_rewrite_tail(str, existing_length, fmt, args);
+ return ralloc_vasprintf_rewrite_tail(str, &existing_length, fmt, args);
}
bool
-ralloc_asprintf_rewrite_tail(char **str, size_t start, const char *fmt, ...)
+ralloc_asprintf_rewrite_tail(char **str, size_t *start, const char *fmt, ...)
{
bool success;
va_list args;
@@ -463,7 +463,7 @@ ralloc_asprintf_rewrite_tail(char **str, size_t start, const char *fmt, ...)
}
bool
-ralloc_vasprintf_rewrite_tail(char **str, size_t start, const char *fmt,
+ralloc_vasprintf_rewrite_tail(char **str, size_t *start, const char *fmt,
va_list args)
{
size_t new_length;
@@ -479,11 +479,12 @@ ralloc_vasprintf_rewrite_tail(char **str, size_t start, const char *fmt,
new_length = printf_length(fmt, args);
- ptr = resize(*str, start + new_length + 1);
+ ptr = resize(*str, *start + new_length + 1);
if (unlikely(ptr == NULL))
return false;
- vsnprintf(ptr + start, new_length + 1, fmt, args);
+ vsnprintf(ptr + *start, new_length + 1, fmt, args);
*str = ptr;
+ *start += new_length;
return true;
}