mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 04:30:28 +00:00
A fix for the flex input files, DONT_COMPILE, and STANDALONE_AEL
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59206 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -241,7 +241,7 @@ 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 {
|
||||||
#if defined(STANDALONE) || defined(LOW_MEMORY)
|
#if defined(STANDALONE) || defined(LOW_MEMORY) || defined(STANDALONE_AEL)
|
||||||
strncpy(buf, io.val->u.s, length - 1);
|
strncpy(buf, io.val->u.s, length - 1);
|
||||||
#else /* !STANDALONE && !LOW_MEMORY */
|
#else /* !STANDALONE && !LOW_MEMORY */
|
||||||
ast_copy_string(buf, io.val->u.s, length);
|
ast_copy_string(buf, io.val->u.s, length);
|
||||||
|
@@ -3122,7 +3122,7 @@ 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 {
|
||||||
#if defined(STANDALONE) || defined(LOW_MEMORY)
|
#if defined(STANDALONE) || defined(LOW_MEMORY) || defined(STANDALONE_AEL)
|
||||||
strncpy(buf, io.val->u.s, length - 1);
|
strncpy(buf, io.val->u.s, length - 1);
|
||||||
#else /* !STANDALONE && !LOW_MEMORY */
|
#else /* !STANDALONE && !LOW_MEMORY */
|
||||||
ast_copy_string(buf, io.val->u.s, length);
|
ast_copy_string(buf, io.val->u.s, length);
|
||||||
|
@@ -411,7 +411,7 @@ includes { STORE_POS; return KW_INCLUDES;}
|
|||||||
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
|
||||||
#if defined(STANDALONE) || defined(LOW_MEMORY)
|
#if defined(STANDALONE) || defined(LOW_MEMORY) || defined(STANDALONE_AEL)
|
||||||
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));
|
||||||
|
@@ -17,10 +17,6 @@
|
|||||||
/* First, we deal with platform-specific or compiler-specific issues. */
|
/* First, we deal with platform-specific or compiler-specific issues. */
|
||||||
|
|
||||||
#include "asterisk.h"
|
#include "asterisk.h"
|
||||||
#ifdef STANDALONE_AEL
|
|
||||||
#define AST_API_MODULE
|
|
||||||
#include "asterisk/strings.h"
|
|
||||||
#endif
|
|
||||||
/* begin standard C headers. */
|
/* begin standard C headers. */
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -1687,7 +1683,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
|
||||||
#if defined(STANDALONE) || defined(LOW_MEMORY)
|
#if defined(STANDALONE) || defined(LOW_MEMORY) || defined(STANDALONE_AEL)
|
||||||
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