r4553 - trunk/src/target/opkg/libopkg

tick at docs.openmoko.org tick at docs.openmoko.org
Wed Jul 23 18:41:48 CEST 2008


Author: tick
Date: 2008-07-23 18:41:47 +0200 (Wed, 23 Jul 2008)
New Revision: 4553

Modified:
   trunk/src/target/opkg/libopkg/user.c
Log:
opkg: Fix a bug that ap may undefined. 
  by Alexandros Kostopoulos <akostop at inaccessnetworks.com>



Modified: trunk/src/target/opkg/libopkg/user.c
===================================================================
--- trunk/src/target/opkg/libopkg/user.c	2008-07-23 08:36:18 UTC (rev 4552)
+++ trunk/src/target/opkg/libopkg/user.c	2008-07-23 16:41:47 UTC (rev 4553)
@@ -33,14 +33,16 @@
      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);





More information about the commitlog mailing list