This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Bug in server_test.c
- From: Grant Edwards <grante at visi dot com>
- To: ecos-discuss at sources dot redhat dot com
- Date: Mon, 24 Mar 2008 14:30:32 +0000 (UTC)
- Subject: [ECOS] Bug in server_test.c
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