diff options
author | ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2008-12-15 00:25:37 (EST) |
---|---|---|
committer | ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2008-12-15 00:25:37 (EST) |
commit | e5e410f66035322b2e20d3c29de5baca0b2b5a60 (patch) | |
tree | 430690a4fa2b89c5e0e09250f6c028168bd19bc8 /libopkg | |
parent | b31ae8d2f84b4d663a95334bd5a16a845b8b5d7d (diff) |
opkg: Fix a bug that ap may undefined.
by Alexandros Kostopoulos <akostop@inaccessnetworks.com>
git-svn-id: http://opkg.googlecode.com/svn/trunk@138 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg')
-rw-r--r-- | libopkg/user.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libopkg/user.c b/libopkg/user.c index af133ba..04dfd9e 100644 --- a/libopkg/user.c +++ b/libopkg/user.c @@ -33,14 +33,16 @@ char *get_user_response(const char *format, ...) int len = question_len; va_list ap; char *response; - va_start(ap, format); do { if (question == NULL || len > question_len) { question = realloc(question, len + 1); question_len = len; } + + va_start(ap, format); len = vsnprintf(question,question_len,format,ap); + va_end(ap); } while (len > question_len); response = strdup(opkg_cb_response(question)); str_chomp(response); |