[ECOS] Bug in server_test.c

Grant Edwards grante@visi.com
Tue Mar 25 10:18:00 GMT 2008


There appears to be a bug in server_test.c:

ecos-opt/net/net/common/current/tests/server_test.c

    94	
    95	#ifdef CYGPKG_LIBC_STDIO        
    96	        sprintf(buf, "Hello %s:%d\n", inet_ntoa(client_addr.sin_addr), ntohs(client_addr.sin_port));
    97	#else        
    98	        strcpy(buf, "Hello ");
    99	        strcat(buf, inet_ntoa(client_addr.sin_addr));
   100	        strcat(buf,":");
   101	        strcat(buf, atoi(ntohs(client_addr.sin_port)));
   102	        strcat(buf,"\n");
   103	#endif

In line 101, the call to atoi() doesn't look right. Shouldn't
that be a call to itoa() (assuming such a function existed)?

-- 
Grant


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list