aboutsummaryrefslogtreecommitdiffstats
path: root/asterisk.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-05-04 14:54:42 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-05-04 14:54:42 +0000
commit3d2252c81d824df7b13198547853215b38f9e81c (patch)
treea24abdff859a43193ef8ae0dec06210f3126adb9 /asterisk.c
parent2a9c1292282f85c8957de69bca15e11b98c7d305 (diff)
More strlen_zero checks (bug #1549)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2887 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'asterisk.c')
-rwxr-xr-xasterisk.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/asterisk.c b/asterisk.c
index d1b0dad3c..a1c1647f6 100755
--- a/asterisk.c
+++ b/asterisk.c
@@ -31,6 +31,7 @@
#include <asterisk/rtp.h>
#include <asterisk/app.h>
#include <asterisk/lock.h>
+#include <asterisk/utils.h>
#include <sys/resource.h>
#include <fcntl.h>
#include <stdio.h>
@@ -546,7 +547,7 @@ static void quit_handler(int num, int nice, int safeshutdown, int restart)
if (option_console || option_remote) {
if (getenv("HOME"))
snprintf(filename, sizeof(filename), "%s/.asterisk_history", getenv("HOME"));
- if (strlen(filename))
+ if (!ast_strlen_zero(filename))
ast_el_write_history(filename);
if (el != NULL)
el_end(el);
@@ -640,7 +641,7 @@ static void consolehandler(char *s)
printf(term_end());
fflush(stdout);
/* Called when readline data is available */
- if (s && strlen(s))
+ if (s && !ast_strlen_zero(s))
ast_el_add_history(s);
/* Give the console access to the shell */
if (s) {
@@ -660,7 +661,7 @@ static int remoteconsolehandler(char *s)
{
int ret = 0;
/* Called when readline data is available */
- if (s && strlen(s))
+ if (s && !ast_strlen_zero(s))
ast_el_add_history(s);
/* Give the console access to the shell */
if (s) {
@@ -1334,7 +1335,7 @@ static void ast_remotecontrol(char * data)
el_set(el, EL_GETCFN, ast_el_read_char);
- if (strlen(filename))
+ if (!ast_strlen_zero(filename))
ast_el_read_history(filename);
ast_cli_register(&quit);
@@ -1350,7 +1351,7 @@ static void ast_remotecontrol(char * data)
for(;;) {
ebuf = (char *)el_gets(el, &num);
- if (ebuf && strlen(ebuf)) {
+ if (ebuf && !ast_strlen_zero(ebuf)) {
if (ebuf[strlen(ebuf)-1] == '\n')
ebuf[strlen(ebuf)-1] = '\0';
if (!remoteconsolehandler(ebuf)) {
@@ -1555,7 +1556,7 @@ int main(int argc, char *argv[])
if (el_hist == NULL || el == NULL)
ast_el_initialize();
- if (strlen(filename))
+ if (!ast_strlen_zero(filename))
ast_el_read_history(filename);
}