All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] fixed tftp error message output
Date: Sat, 19 Jul 2003 21:28:14 +0200	[thread overview]
Message-ID: <20030719192819.B3ED3C6D82@atlas.denx.de> (raw)
In-Reply-To: Your message of "19 Jul 2003 04:34:30 +0200." <1058582070.943.37.camel@localhost>

Dear Andreas,

in message <1058582070.943.37.camel@localhost> you 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?

>  	case TFTP_ERROR:
> -		printf ("\nTFTP error: '%s' (%d)\n",
> -					pkt + 2, ntohs(*(ushort *)pkt));
> +		printf ("\nTFTP error %d: ", ntohs(*(ushort *)pkt));
> +		pkt += 2;
> +		len -= 2;
> +		while (len--)
> +			printf("%c", *pkt++);
> +		printf("\n");
> +

Patch rejected. What happens if "len" turns out to be zero?
Also, the code is unnecessary complex.

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) ?

Thanks.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
A memorandum is written not to inform the reader, but to protect  the
writer.                                               -- Dean Acheson

  reply	other threads:[~2003-07-19 19:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-19  2:34 [U-Boot-Users] [PATCH] fixed tftp error message output Andreas Oberritter
2003-07-19 19:28 ` Wolfgang Denk [this message]
2003-07-19 20:28   ` Andreas Oberritter
2003-07-19 21:59     ` Wolfgang Denk
2003-07-19 22:31       ` Andreas Oberritter
2003-07-20 12:53         ` Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030719192819.B3ED3C6D82@atlas.denx.de \
    --to=wd@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.