Skip to contentSkip to conversation

LVM2/libdm libdm-string.c

PATCH [email protected] 1 participant 1 message Nov 23, 2010

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac at sourceware.org 2010-11-23 15:00:52

Modified files:
libdm : libdm-string.c

Log message:
Move va_end(ap) so we do not leave with return -1 without calling it. Remove unneeded ';'

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-string.c.diff?cvsroot=lvm2&r1=1.13&r2=1.14

libdm/libdm-string.c +3 -2
@@ -144,6 +144,8 @@
 	while (!ok) {
 		va_start(ap, format);
 		n = vsnprintf(buf, size, format, ap);
+		va_end(ap);
+
 		if (0 <= n && n < size)
 			ok = 1;
 		else {
@@ -152,8 +154,7 @@
 			buf = dm_malloc(size);
 			if (!buf)
 				return -1;
-		};
-		va_end(ap);
+		}
 	}
 
 	*result = dm_strdup(buf);