git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Make ds_cstr() always null-terminate the string.
[sliver-openvswitch.git]
/
lib
/
dynamic-string.c
diff --git
a/lib/dynamic-string.c
b/lib/dynamic-string.c
index
2fe8cfb
..
1df85ac
100644
(file)
--- a/
lib/dynamic-string.c
+++ b/
lib/dynamic-string.c
@@
-177,8
+177,8
@@
ds_cstr(struct ds *ds)
{
if (!ds->string) {
ds_reserve(ds, 0);
- ds->string[0] = '\0';
}
+ ds->string[ds->length] = '\0';
return ds->string;
}