mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Fix a bunch of off-by-one errors
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@221776 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -963,7 +963,7 @@ static void *netconsole(void *vconsole)
|
||||
continue;
|
||||
}
|
||||
if (fds[0].revents) {
|
||||
res = read(con->fd, tmp, sizeof(tmp));
|
||||
res = read(con->fd, tmp, sizeof(tmp) - 1);
|
||||
if (res < 1) {
|
||||
break;
|
||||
}
|
||||
@@ -2144,7 +2144,7 @@ static char *cli_complete(EditLine *el, int ch)
|
||||
if (ast_opt_remote) {
|
||||
snprintf(buf, sizeof(buf),"_COMMAND NUMMATCHES \"%s\" \"%s\"", lf->buffer, ptr);
|
||||
fdsend(ast_consock, buf);
|
||||
res = read(ast_consock, buf, sizeof(buf));
|
||||
res = read(ast_consock, buf, sizeof(buf) - 1);
|
||||
buf[res] = '\0';
|
||||
nummatches = atoi(buf);
|
||||
|
||||
|
Reference in New Issue
Block a user