mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
Merged revisions 49009 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r49009 | file | 2006-12-27 17:28:46 -0500 (Wed, 27 Dec 2006) | 2 lines 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) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -3134,11 +3134,11 @@ int ast_expr(char *expr, char *buf, int length)
|
|||||||
res_length = snprintf(buf, length, "%ld", (long int) io.val->u.i);
|
res_length = snprintf(buf, length, "%ld", (long int) io.val->u.i);
|
||||||
return_value = (res_length <= length) ? res_length : length;
|
return_value = (res_length <= length) ? res_length : length;
|
||||||
} else {
|
} else {
|
||||||
#ifdef STANDALONE
|
#if defined(STANDALONE) || defined(LOW_MEMORY)
|
||||||
strncpy(buf, io.val->u.s, length - 1);
|
strncpy(buf, io.val->u.s, length - 1);
|
||||||
#else /* !STANDALONE */
|
#else /* !STANDALONE && !LOW_MEMORY */
|
||||||
ast_copy_string(buf, io.val->u.s, length);
|
ast_copy_string(buf, io.val->u.s, length);
|
||||||
#endif /* STANDALONE */
|
#endif /* STANDALONE || LOW_MEMORY */
|
||||||
return_value = strlen(buf);
|
return_value = strlen(buf);
|
||||||
free(io.val->u.s);
|
free(io.val->u.s);
|
||||||
}
|
}
|
||||||
|
@@ -1689,7 +1689,7 @@ YY_RULE_SETUP
|
|||||||
if (*(p1+1) != '/')
|
if (*(p1+1) != '/')
|
||||||
snprintf(fnamebuf, sizeof(fnamebuf), "%s/%s", ast_config_AST_CONFIG_DIR, p1 + 1);
|
snprintf(fnamebuf, sizeof(fnamebuf), "%s/%s", ast_config_AST_CONFIG_DIR, p1 + 1);
|
||||||
else
|
else
|
||||||
#ifdef STANDALONE
|
#if defined(STANDALONE) || defined(LOW_MEMORY)
|
||||||
strncpy(fnamebuf, p1 + 1, sizeof(fnamebuf) - 1);
|
strncpy(fnamebuf, p1 + 1, sizeof(fnamebuf) - 1);
|
||||||
#else
|
#else
|
||||||
ast_copy_string(fnamebuf, p1 + 1, sizeof(fnamebuf));
|
ast_copy_string(fnamebuf, p1 + 1, sizeof(fnamebuf));
|
||||||
|
Reference in New Issue
Block a user