Skip to contentSkip to conversation

net/tftp.c: fix warning: pointer targets differ in signedness

PATCH New Wolfgang Denk 2 participants 2 messages Aug 10, 2009 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/tftp.c: fix warning: pointer targets differ in signedness

tftp.c:294: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness

This was only visible for the utx8245 board which seems to have DEBUG enabled.

---
 net/tftp.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
net/tftp.c +3 -1
index 74d9e42..fb98a34 100644
@@ -291,7 +291,9 @@ TftpHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len)
 		break;
 
 	case TFTP_OACK:
-		debug("Got OACK: %s %s\n", pkt, pkt+strlen(pkt)+1);
+		debug("Got OACK: %s %s\n",
+			pkt,
+			pkt + strlen((char *)pkt) + 1);
 		TftpState = STATE_OACK;
 		TftpServerPort = src;
 		/*
Signature · 1 line
1.6.0.6
Applied
#1 lore raw

PATCH 1/1 net/tftp.c: fix warning: pointer targets differ in signedness

Wolfgang,

Quoted 17 lines · Wolfgang Denk

tftp.c:294: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness

This was only visible for the utx8245 board which seems to have DEBUG enabled.

---
 net/tftp.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
net/tftp.c +0 -0
index 74d9e42..fb98a34 100644

net/tftp.c TftpHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len) · line 299

Quoted 10 lines
net/tftp.c +3 -1
@@ -291,7 +291,9 @@ TftpHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len)
 		break;
 
 	case TFTP_OACK:
-		debug("Got OACK: %s %s\n", pkt, pkt+strlen(pkt)+1);
+		debug("Got OACK: %s %s\n",
+			pkt,
+			pkt + strlen((char *)pkt) + 1);
 		TftpState = STATE_OACK;
 		TftpServerPort = src;
 		/*

Applied to net repo.

thanks,
Ben