projects
/
openvswitch
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
15a27cb
)
cfg: Always null-terminate the cfg array.
author
Ben Pfaff
<blp@nicira.com>
Tue, 7 Apr 2009 18:07:34 +0000
(11:07 -0700)
committer
Ben Pfaff
<blp@nicira.com>
Tue, 7 Apr 2009 18:16:30 +0000
(11:16 -0700)
Some functions depend on the cfg array being null-terminated, so be sure
to make it so when modifying the array.
cfg_add_entry() still doesn't sort the array, but it should.
lib/cfg.c
patch
|
blob
|
history
diff --git
a/lib/cfg.c
b/lib/cfg.c
index 203880d21156a094cb439868ad1e7e195a69a110..8d9a4d0970e94b72653cb93f6b2e8ee763ad34ce 100644
(file)
--- a/
lib/cfg.c
+++ b/
lib/cfg.c
@@
-500,6
+500,7
@@
cfg_add_entry(const char *entry_, ...)
FORMAT_KEY(entry_, entry);
svec_add_nocopy(&cfg, entry);
+ svec_terminate(&cfg);
dirty = true;
}
@@
-510,6
+511,7
@@
cfg_del_entry(const char *entry_, ...)
FORMAT_KEY(entry_, entry);
svec_del(&cfg, entry);
+ svec_terminate(&cfg);
free(entry);
dirty = true;
}