[svn-commits] file: branch 1.4 r49009 - in /branches/1.4: main/ast_expr2f.c pbx/ael/ael_lex.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Wed Dec 27 15:28:46 MST 2006


Author: file
Date: Wed Dec 27 16:28:46 2006
New Revision: 49009

URL: http://svn.digium.com/view/asterisk?view=rev&rev=49009
Log:
ast_copy_string is not available when LOW_MEMORY is used and things are being built in the utils directory, so we need to resort to the old method of strncpy. (issue #8579 reported by mottano)

Modified:
    branches/1.4/main/ast_expr2f.c
    branches/1.4/pbx/ael/ael_lex.c

Modified: branches/1.4/main/ast_expr2f.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/ast_expr2f.c?view=diff&rev=49009&r1=49008&r2=49009
==============================================================================
--- branches/1.4/main/ast_expr2f.c (original)
+++ branches/1.4/main/ast_expr2f.c Wed Dec 27 16:28:46 2006
@@ -3134,11 +3134,11 @@
 			res_length = snprintf(buf, length, "%ld", (long int) io.val->u.i);
 			return_value = (res_length <= length) ? res_length : length;
 		} else {
-#ifdef STANDALONE
+#if defined(STANDALONE) || defined(LOW_MEMORY)
 			strncpy(buf, io.val->u.s, length - 1);
-#else /* !STANDALONE */
+#else /* !STANDALONE && !LOW_MEMORY */
 			ast_copy_string(buf, io.val->u.s, length);
-#endif /* STANDALONE */
+#endif /* STANDALONE || LOW_MEMORY */
 			return_value = strlen(buf);
 			free(io.val->u.s);
 		}

Modified: branches/1.4/pbx/ael/ael_lex.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/pbx/ael/ael_lex.c?view=diff&rev=49009&r1=49008&r2=49009
==============================================================================
--- branches/1.4/pbx/ael/ael_lex.c (original)
+++ branches/1.4/pbx/ael/ael_lex.c Wed Dec 27 16:28:46 2006
@@ -1689,7 +1689,7 @@
 			if (*(p1+1) != '/')
 				snprintf(fnamebuf, sizeof(fnamebuf), "%s/%s", ast_config_AST_CONFIG_DIR, p1 + 1);
 			else
-#ifdef STANDALONE
+#if defined(STANDALONE) || defined(LOW_MEMORY)
 				strncpy(fnamebuf, p1 + 1, sizeof(fnamebuf) - 1);
 #else
 				ast_copy_string(fnamebuf, p1 + 1, sizeof(fnamebuf));



More information about the svn-commits mailing list