]> git.kernelconcepts.de Git - karo-tx-redboot.git/blobdiff - packages/net/common/v2_0/tests/server_test.c
unified MX27, MX25, MX37 trees
[karo-tx-redboot.git] / packages / net / common / v2_0 / tests / server_test.c
index 5bd0a7e0ab27aac527b9494019f8b423cac6f752..3eaf171104988e7843567f9ac4676b9f457ed24a 100644 (file)
@@ -55,7 +55,8 @@ pexit(char *s)
 static void
 server_test(struct bootp *bp)
 {
-    int s, client, client_len;
+    int s, client;
+    socklen_t client_len;
     struct sockaddr_in client_addr, local;
     char buf[256];
     int one = 1;
@@ -91,15 +92,7 @@ server_test(struct bootp *bp)
         getpeername(client, (struct sockaddr *)&client_addr, &client_len);
         diag_printf("connection from %s:%d\n", inet_ntoa(client_addr.sin_addr), ntohs(client_addr.sin_port));
 
-#ifdef CYGPKG_LIBC_STDIO        
-        sprintf(buf, "Hello %s:%d\n", inet_ntoa(client_addr.sin_addr), ntohs(client_addr.sin_port));
-#else        
-        strcpy(buf, "Hello ");
-        strcat(buf, inet_ntoa(client_addr.sin_addr));
-        strcat(buf,":");
-        strcat(buf, atoi(ntohs(client_addr.sin_port)));
-        strcat(buf,"\n");
-#endif
+        diag_sprintf(buf, "Hello %s:%d\n", inet_ntoa(client_addr.sin_addr), ntohs(client_addr.sin_port));
         
         write(client, buf, strlen(buf));
         tv.tv_sec = 5;