From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FElGI-0004Rb-Tr for qemu-devel@nongnu.org; Thu, 02 Mar 2006 05:42:25 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FElEb-0004Hj-AB for qemu-devel@nongnu.org; Thu, 02 Mar 2006 05:42:16 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FElET-0004Gr-6p for qemu-devel@nongnu.org; Thu, 02 Mar 2006 05:40:32 -0500 Received: from [64.233.182.194] (helo=nproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FElFv-0001h8-JY for qemu-devel@nongnu.org; Thu, 02 Mar 2006 05:41:59 -0500 Received: by nproxy.gmail.com with SMTP id x37so261916nfc for ; Thu, 02 Mar 2006 02:40:27 -0800 (PST) Subject: Re: [Qemu-devel] Printing bogus values in ne2000_asic_ioport_read()/ ne2000_receive() From: Alessandro Iurlano In-Reply-To: <20060225182908.21386.qmail@web36810.mail.mud.yahoo.com> References: <20060225182908.21386.qmail@web36810.mail.mud.yahoo.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-McX+TcyAgNc1fwnPY3AL" Date: Thu, 02 Mar 2006 11:40:15 +0100 Message-Id: <1141296015.3770.0.camel@localhost> Mime-Version: 1.0 Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --=-McX+TcyAgNc1fwnPY3AL Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Il giorno sab, 25/02/2006 alle 10.29 -0800, Umamaheswararao Karyampudi ha scritto: > In ne2000_receive(), I copied the packet received to a > static char [] and printed the packet using > static void print_packet(char *s, int len) > { > int i,j; > for (i=3D0;i if (i%20 =3D=3D 0) > printf("\n"); > printf("%02x ", s[i]); > } > printf("\n"); > } > And some bytes it prints as fffffffff > instead of just the last byte. > For eg: > 52 54 00 12 34 56 00 ffffffff 4f 0a 46 05 08 00 45 00 > 00 ffffff80 00 00 > 40 00 40 01 ffffffbc 2b ffffffc0 ffffffa8 fffffffe > fffffffe ffffffc0 ffffffa8 ff >=20 Maybe it's just a sign problem. Try declaring the s[] buffer as unsigned char instead of just char. Hope this helps, Alessandro --=-McX+TcyAgNc1fwnPY3AL Content-Type: application/pgp-signature; name=signature.asc Content-Description: Questa parte del messaggio =?ISO-8859-1?Q?=E8?= firmata -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQBEBsuP5oyoQVt84V0RAuMWAJ94zaePS7PwuG9NUWy3cLeIUHdFMACeK5Ug zTXT5/ZXmzasyrOAFGFUKP4= =Z3i3 -----END PGP SIGNATURE----- --=-McX+TcyAgNc1fwnPY3AL--