[U-Boot] [PATCHv2 4/8] mkenvimage: More error handling

Mike Frysinger vapier at gentoo.org
Sun Jan 8 07:49:13 CET 2012


On Thursday 05 January 2012 13:44:55 David Wagner wrote:
> --- a/tools/mkenvimage.c
> +++ b/tools/mkenvimage.c
>
>  			datasize = strtol(optarg, NULL, 0);
> -			break;
> +			if (!errno)
> +				break;
> +
> +			if (errno == ERANGE)
> +				fprintf(stderr, "Bad integer format: %s\n",
> +						optarg);
> +			else
> +				fprintf(stderr, "Error while parsing %s: %s\n",
> +						optarg, strerror(errno));
> +
> +			return EXIT_FAILURE;

seems like this should be a local xstrol() helper
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120108/79159b3b/attachment.pgp>


More information about the U-Boot mailing list