summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2011-02-24 10:15:47 +0100
committerGuillem Jover <guillem@debian.org>2011-03-02 07:26:41 +0100
commitf1bccd4763343d0897db3361022fec8ab5411a34 (patch)
tree25e2a60963085b957c37db1e03c24ac4729a2fae /src/main.c
parent3ae09f975d9138de3c51359ef9ba0d7776a4cc86 (diff)
downloaddpkg-f1bccd4763343d0897db3361022fec8ab5411a34.tar.gz
Use varbuf_end_str() instead of ad-hoc varbuf_add_char() calls
This allows the strings to be terminated, thus printable or accessed through the standard C string functions, and at the same time appendable.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 8c8269242..3096174a2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -670,11 +670,11 @@ void commandfd(const char *const *argv) {
} while (c != EOF && c != '\n');
if (c == EOF) ohshit(_("unexpected eof before end of line %d"),lno);
if (!argc) continue;
- varbuf_add_char(&linevb, '\0');
+ varbuf_end_str(&linevb);
newargs = m_realloc(newargs, sizeof(const char *) * (argc + 1));
argc= 1;
ptr= linevb.buf;
- endptr= ptr + linevb.used;
+ endptr = ptr + linevb.used + 1;
skipchar = false;
while(ptr < endptr) {
if (skipchar) {