/[monit]/monit/socket.c
ViewVC logotype

Diff of /monit/socket.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.28 by hauk, Fri Sep 19 03:44:17 2003 UTC revision 1.29 by hauk, Sun Sep 21 03:57:11 2003 UTC
# Line 471  int socket_read(Socket_T S, void *b, int Line 471  int socket_read(Socket_T S, void *b, int
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);
# Line 481  char *socket_readln(Socket_T S, char *s, Line 480  char *socket_readln(Socket_T S, char *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    }    }

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26