diff options
Diffstat (limited to 'erts/etc/common')
-rw-r--r-- | erts/etc/common/heart.c | 6 | ||||
-rw-r--r-- | erts/etc/common/inet_gethost.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/erts/etc/common/heart.c b/erts/etc/common/heart.c index 778b3569c7..7a5746e630 100644 --- a/erts/etc/common/heart.c +++ b/erts/etc/common/heart.c @@ -727,16 +727,16 @@ static int heart_cmd_reply(int fd, char *s) { struct msg m; - int len = strlen(s) + 1; /* Include \0 */ + int len = strlen(s); /* if s >= MSG_BODY_SIZE, return a write * failure immediately. */ - if (len > sizeof(m.fill)) + if (len >= sizeof(m.fill)) return -1; m.op = HEART_CMD; - m.len = htons(len + 2); /* Include Op */ + m.len = htons(len + 1); /* Include Op */ strcpy((char*)m.fill, s); return write_message(fd, &m); diff --git a/erts/etc/common/inet_gethost.c b/erts/etc/common/inet_gethost.c index 8bd9368aa1..18ccf974aa 100644 --- a/erts/etc/common/inet_gethost.c +++ b/erts/etc/common/inet_gethost.c @@ -1297,7 +1297,7 @@ static int read_request(AddrByte **buff, size_t *buff_size) } if (siz > *buff_size) { - if (buff_size == 0) { + if (*buff_size == 0) { *buff = ALLOC((*buff_size = siz)); } else { *buff = REALLOC(*buff, (*buff_size = siz)); |