提交 504b632c authored 作者: Anthony Minessale's avatar Anthony Minessale

update

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7102 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 11b8615a
......@@ -70,7 +70,7 @@ SWITCH_DECLARE(switch_size_t) switch_fd_read_line(int fd, char *buf, switch_size
switch_size_t total = 0;
p = buf;
while (total + sizeof(c) < len && (cur = read(fd, &c, sizeof(c))) > 0) {
while (total + 2 < len && (cur = read(fd, &c, 1)) == 1) {
total += cur;
*p++ = c;
if (c == '\r' || c == '\n') {
......@@ -79,6 +79,7 @@ SWITCH_DECLARE(switch_size_t) switch_fd_read_line(int fd, char *buf, switch_size
}
*p++ = '\0';
assert(total < len);
return total;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论