[BusyBox] [PATCH] fix tftp debug message

Hideki IWAMOTO h-iwamoto at kit.hi-ho.ne.jp
Thu Feb 26 15:07:22 UTC 2004


>dd if=/dev/zero of=/tftpboot/a bs=512 count=128
128+0 records in
128+0 records out
>gcc -dM -E - < /dev/null | grep __CHAR_UNSIGNED__

[current CVS version]

>_install/usr/bin/tftp -g -r a -l /tmp/a localhost |& tail 
00 04 00 7e 
received 516 bytes: 0003 007f
sending 4 bytes
00 04 00 7f 
received 516 bytes: 0003 0080
sending 4 bytes
00 04 00 ffffff80 
received 4 bytes: 0003 0081
sending 4 bytes
00 04 00 ffffff81 


[patched version]

>_install/usr/bin/tftp -g -r a -l /tmp/a localhost | & tail
00 04 00 7e 
received 516 bytes: 0003 007f
sending 4 bytes
00 04 00 7f 
received 516 bytes: 0003 0080
sending 4 bytes
00 04 00 80 
received 4 bytes: 0003 0081
sending 4 bytes
00 04 00 81 

Index: networking/tftp.c
===================================================================
RCS file: /var/cvs/busybox/networking/tftp.c,v
retrieving revision 1.24
diff -u -r1.24 tftp.c
--- networking/tftp.c	26 Feb 2004 07:47:20 -0000	1.24
+++ networking/tftp.c	26 Feb 2004 14:42:33 -0000
@@ -294,7 +294,7 @@
 #ifdef CONFIG_FEATURE_TFTP_DEBUG
 			fprintf(stderr, "sending %u bytes\n", len);
 			for (cp = buf; cp < &buf[len]; cp++)
-				fprintf(stderr, "%02x ", *cp);
+				fprintf(stderr, "%02x ", (unsigned char)*cp);
 			fprintf(stderr, "\n");
 #endif
 			if (sendto(socketfd, buf, len, 0,

----
Hideki IWAMOTO  h-iwamoto at kit.hi-ho.ne.jp




More information about the busybox mailing list