471 |
*/ |
*/ |
472 |
char *socket_readln(Socket_T S, char *s, int size) { |
char *socket_readln(Socket_T S, char *s, int size) { |
473 |
|
|
|
char c; |
|
474 |
char *p= s; |
char *p= s; |
475 |
|
|
476 |
ASSERT(S); |
ASSERT(S); |
480 |
* from the socket not just one by one byte, this is horribly |
* from the socket not just one by one byte, this is horribly |
481 |
* ineffective. |
* ineffective. |
482 |
*/ |
*/ |
483 |
while(--size && ((socket_read(S, &c, 1)) > 0)) { |
while(--size && ((socket_read(S, s, 1)) > 0)) { |
|
*s= c; |
|
484 |
if(*s++ == 10) |
if(*s++ == 10) |
485 |
break; |
break; |
486 |
} |
} |