[asterisk-commits] branch crichter/0.3.0 - r8094 in /team/crichter/0.3.0: ./ funcs/func_strings.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Jan 16 01:06:56 MST 2006


Author: crichter
Date: Mon Jan 16 02:06:53 2006
New Revision: 8094

URL: http://svn.digium.com/view/asterisk?rev=8094&view=rev
Log:
Merged revisions 8074 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r8074 | tilghman | 2006-01-14 20:06:44 +0100 (Sa, 14 Jan 2006) | 2 lines

Bug 6238 - Fix segfault when delimiter not specified

........

Modified:
    team/crichter/0.3.0/   (props changed)
    team/crichter/0.3.0/funcs/func_strings.c

Propchange: team/crichter/0.3.0/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Jan 16 02:06:53 2006
@@ -1,1 +1,1 @@
-/branches/1.2:1-7496,7498-7914,7916-7959,7961-7964,7966-7969,7971-7975,7977-8053
+/branches/1.2:1-7496,7498-7914,7916-7959,7961-7964,7966-7969,7971-7975,7977-8093

Modified: team/crichter/0.3.0/funcs/func_strings.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/funcs/func_strings.c?rev=8094&r1=8093&r2=8094&view=diff
==============================================================================
--- team/crichter/0.3.0/funcs/func_strings.c (original)
+++ team/crichter/0.3.0/funcs/func_strings.c Mon Jan 16 02:06:53 2006
@@ -50,8 +50,12 @@
 	if (delim) {
 		varname = strsep(&delim, "|");
 		pbx_retrieve_variable(chan, varname, &varval, workspace, sizeof(workspace), NULL);
-		while (strsep(&varval, delim))
-			fieldcount++;
+		if (delim) {
+			while (strsep(&varval, delim))
+				fieldcount++;
+		} else if (!ast_strlen_zero(varval)) {
+			fieldcount = 1;
+		}
 		snprintf(buf, len, "%d", fieldcount);
 	} else {
 		ast_log(LOG_ERROR, "Out of memory\n");



More information about the asterisk-commits mailing list