ossp-pkg/xds/vdecode.c 1.3 -> 1.4
--- vdecode.c 2001/07/16 17:50:07 1.3
+++ vdecode.c 2001/07/24 15:46:18 1.4
@@ -32,6 +32,7 @@
int xds_vdecode(xds_t* xds, const char* fmt_arg, va_list args)
{
+ size_t buffer_len_backup;
char* name;
char* p;
char* fmt;
@@ -58,6 +59,7 @@
fmt = p = strdup(fmt_arg);
if (fmt == NULL)
return XDS_ERR_NO_MEM;
+ buffer_len_backup = xds->buffer_len;
for(name = p; *p != '\0'; name = p)
{
while(isalnum(*p) || *p == '-' || *p == '_')
@@ -94,5 +96,7 @@
/* Clean up and leave. */
leave:
free(fmt);
+ if (rc != XDS_OK)
+ xds->buffer_len = buffer_len_backup;
return rc;
}
|
|