[Freeswitch-svn] [commit] r4763 - freeswitch/trunk/src

Freeswitch SVN mikej at freeswitch.org
Sat Mar 24 15:54:38 EDT 2007


Author: mikej
Date: Sat Mar 24 15:54:38 2007
New Revision: 4763

Modified:
   freeswitch/trunk/src/switch_apr.c

Log:
a bit cleaner.

Modified: freeswitch/trunk/src/switch_apr.c
==============================================================================
--- freeswitch/trunk/src/switch_apr.c	(original)
+++ freeswitch/trunk/src/switch_apr.c	Sat Mar 24 15:54:38 2007
@@ -618,17 +618,15 @@
 	size_t buflen;
 
 	len = vsnprintf(NULL, 0, fmt, ap);
-	if (len > 0) {
-		buflen = (size_t)(len + 1);
-		if ((buf = malloc(buflen)) == NULL) {
-			*ret = NULL;
-			return -1;
-		}
+
+	if (len > 0 && (buf = malloc((buflen = (size_t)(len + 1)))) != NULL) {
 		len = vsnprintf(buf, buflen, fmt, ap);
 		*ret = buf;
 	} else {
 		*ret = NULL;
+		len = -1;
 	}
+
 	return len;
 
 #endif



More information about the Freeswitch-svn mailing list