[svn-commits] rizzo: trunk r48499 - in /trunk: include/asterisk/channel.h main/channel.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Fri Dec 15 08:45:00 MST 2006


Author: rizzo
Date: Fri Dec 15 09:44:59 2006
New Revision: 48499

URL: http://svn.digium.com/view/asterisk?view=rev&rev=48499
Log:
remove ast_safe_string_alloc() - it is completely
equivalent to asprintf().


Modified:
    trunk/include/asterisk/channel.h
    trunk/main/channel.c

Modified: trunk/include/asterisk/channel.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/channel.h?view=diff&rev=48499&r1=48498&r2=48499
==============================================================================
--- trunk/include/asterisk/channel.h (original)
+++ trunk/include/asterisk/channel.h Fri Dec 15 09:44:59 2006
@@ -1143,12 +1143,6 @@
 
 void ast_set_callerid(struct ast_channel *chan, const char *cidnum, const char *cidname, const char *ani);
 
-
-/*! return a mallocd string with the result of sprintf of the fmt and following args */
-char *ast_safe_string_alloc(const char *fmt, ...);
-
-
-
 /*! Start a tone going */
 int ast_tonepair_start(struct ast_channel *chan, int freq1, int freq2, int duration, int vol);
 /*! Stop a tone from playing */

Modified: trunk/main/channel.c
URL: http://svn.digium.com/view/asterisk/trunk/main/channel.c?view=diff&rev=48499&r1=48498&r2=48499
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Fri Dec 15 09:44:59 2006
@@ -329,21 +329,6 @@
 	res = ast_check_hangup(chan);
 	ast_channel_unlock(chan);
 	return res;
-}
-
-/*! \brief printf the string into a correctly sized mallocd buffer, and return the buffer */
-char *ast_safe_string_alloc(const char *fmt, ...)
-{
-	char *b2,buf[1];
-	int len;
-
-	va_list args;
-	va_start(args, fmt);
-	len = vsnprintf(buf, 1, fmt, args);
-	b2 = ast_malloc(len+1);
-	vsnprintf(b2, len+1,  fmt, args);
-	va_end(args);
-	return b2;
 }
 
 /*! \brief Initiate system shutdown */



More information about the svn-commits mailing list