Skip to content

Commit eb5bd7b

Browse files
authored
change addr_len to type socklen_t instead of int and fixed while condition
1 parent d6aa265 commit eb5bd7b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

foundation/software.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,8 @@ out the characters that arrive on the connection.
326326
{
327327
struct sockaddr_in sin;
328328
char buf[MAX_LINE];
329-
int buf_len, addr_len;
329+
int buf_len;
330+
socklen_t addr_len;
330331
int s, new_s;
331332
332333
/* build address data structure */
@@ -352,7 +353,7 @@ out the characters that arrive on the connection.
352353
perror("simplex-talk: accept");
353354
exit(1);
354355
}
355-
while (buf_len = recv(new_s, buf, sizeof(buf), 0))
356+
while (buf_len == recv(new_s, buf, sizeof(buf), 0))
356357
fputs(buf, stdout);
357358
close(new_s);
358359
}

0 commit comments

Comments
 (0)