little clean
This commit is contained in:
		
							parent
							
								
									a1f8b096e3
								
							
						
					
					
						commit
						bfef02de49
					
				| @ -11,19 +11,21 @@ | ||||
| #include  <arpa/inet.h> | ||||
| 
 | ||||
| #define BINDADDR	"127.0.0.1" | ||||
| #define TL		20 | ||||
| #define BINDPORT	5678 | ||||
| 
 | ||||
| #define TL		20		/* important value */ | ||||
| 
 | ||||
| int main(int argc, char *argv[]) | ||||
| { | ||||
| int			foo, len, sock; | ||||
| char			*adr_ip = BINDADDR; | ||||
| int			port = 5678; | ||||
| char			*adr_ip  = BINDADDR; | ||||
| int			port     = BINDPORT; | ||||
| unsigned int		addrlen; | ||||
| int			connected; | ||||
| struct sockaddr_in	addr; | ||||
| struct in_addr		ia; | ||||
| FILE			*fpin; | ||||
| char			line[TL+5], *ptr; | ||||
| char			line[TL+5]; | ||||
| 
 | ||||
| fprintf(stderr, "--- %s ---\n", argv[0]); | ||||
| 
 | ||||
| @ -71,7 +73,7 @@ for (;;) { | ||||
| 		} | ||||
| 	// fprintf(stderr, "fopened...\n");
 | ||||
| 
 | ||||
| 	while ( (ptr=fgets(line, TL, fpin)) ) { | ||||
| 	while ( fgets(line, TL, fpin) ) { | ||||
| 		len = strlen(line); | ||||
| 		fprintf(stderr, "   %3d  |  %s", len, line); | ||||
| 		for (foo=0; foo<len; foo++) { | ||||
| @ -79,7 +81,8 @@ for (;;) { | ||||
| 			} | ||||
| 		fputs("\n", fpin); | ||||
| 		} | ||||
| 	close(connected); | ||||
| 	fclose(fpin); | ||||
| 	// close(connected);
 | ||||
| 	} /* end of the endless loop */ | ||||
| 
 | ||||
| return 0; | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 tTh
						tTh