ossp-pkg/var/var.c 1.44 -> 1.45
--- var.c 2001/12/12 16:52:56 1.44
+++ var.c 2001/12/12 17:18:55 1.45
@@ -1965,5 +1965,18 @@
lookup, lookup_context, force_expand, &output, 0, 0);
*result = (char *)output.begin;
*result_len = output.end - output.begin;
- return (rc >= 0) ? VAR_OK : rc;
+ if (rc >= 0)
+ {
+ if (!tokenbuf_append(&output, "\0", 1))
+ {
+ tokenbuf_free(&output);
+ return VAR_ERR_OUT_OF_MEMORY;
+ }
+ --output.end;
+ rc = VAR_OK;
+ }
+
+ *result = (char *)output.begin;
+ *result_len = output.end - output.begin;
+ return rc;
}
|
|