From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Oberritter Date: 19 Jul 2003 22:28:34 +0200 Subject: [U-Boot-Users] [PATCH] fixed tftp error message output In-Reply-To: <20030719192819.B3ED3C6D82@atlas.denx.de> References: <20030719192819.B3ED3C6D82@atlas.denx.de> Message-ID: <1058646514.774.55.camel@localhost> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Sat, 2003-07-19 at 21:28, Wolfgang Denk wrote: > > This patch fixes tftp error message output, i.e. does not print the last > > two bytes which contain garbage (at least for my setup, I hope this is > > not a tftp server issue). > > Is there a way to provoke such an error, so we can test this? Just try to tftp a file which does not exist on the server or which does not have correct permissions (leading to a "file not found" message). I am using atftpd on debian sarge and sid. > What happens if "len" turns out to be zero? Ok, I'll add a check for it. > If there really is such a problem, this should do as well (and maybe > better): > > printf ("\nTFTP error: '%.*s' (%d)\n", > len - 2, > pkt + 2, > ntohs(*(ushort *)pkt) ); > > Can you please test this (and eventually re-submit the patch) ? I see, this would indeed be simpler. I didn't know %.*s until now. I will try it when I come home next week. Regards, Andreas