[U-Boot-Users] [PATCH] fixed tftp error message output
Andreas Oberritter
obi at saftware.de
Sat Jul 19 22:28:34 CEST 2003
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
More information about the U-Boot
mailing list