The special case for len==0 was wrong---the normal code path is to
talloc to get a newly allocated, editable string, that might be
talloc_free'd later. It makes more sense just to let the len==0
behaviour fall through into the normal case code.
Reviewed-by: Carl Worth <cworth@cworth.org>
This results in the same value being returned, but with the proper
memory handling.
size_t loop;
size_t required;
- if (len == 0)
- return (char *)"\"\"";
-
for (loop = 0, required = 0, ptr = str;
loop < len;
loop++, required++, ptr++) {