aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-12 22:22:54 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-12 22:22:54 +0000
commit47161f4d924d5a920a36e11c970f8bdf4cb263fe (patch)
tree359630c41414ce931e39560d7a0569ea8f890335 /main
parentc667b2c829882669342d51369991f75da48568af (diff)
Remove condition that was impossible.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@103503 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/asterisk.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index ecfca97d4..52266b455 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -1721,7 +1721,8 @@ static int ast_el_read_char(EditLine *el, char *cp)
struct pollfd fds[2];
int res;
int max;
- char buf[512];
+#define EL_BUF_SIZE 512
+ char buf[EL_BUF_SIZE];
for (;;) {
max = 1;
@@ -1784,7 +1785,7 @@ static int ast_el_read_char(EditLine *el, char *cp)
if (!ast_opt_exec && !lastpos)
write(STDOUT_FILENO, "\r", 1);
write(STDOUT_FILENO, buf, res);
- if ((buf[res-1] == '\n') || (buf[res-2] == '\n')) {
+ if ((res < EL_BUF_SIZE - 1) && ((buf[res-1] == '\n') || (buf[res-2] == '\n'))) {
*cp = CC_REFRESH;
return(1);
} else {