Re: [PATCH] scripts/rsatoc: fix printing of error message, if environment variable doen't contain a path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 29, 2020 at 01:12:40PM +0200, Marc Kleine-Budde wrote:
> Fixes: 128ad3cbe043 ("scripts: Add rsatoc tool")
> Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
> ---
>  scripts/rsatoc.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Applied to master, thanks

Sascha

> 
> diff --git a/scripts/rsatoc.c b/scripts/rsatoc.c
> index 647380214092..9410f33a654f 100644
> --- a/scripts/rsatoc.c
> +++ b/scripts/rsatoc.c
> @@ -471,10 +471,12 @@ int main(int argc, char *argv[])
>  		path++;
>  
>  		if (!strncmp(path, "__ENV__", 7)) {
> -			path = getenv(path + 7);
> +			const char *orig_path = path;
> +			
> +			path = getenv(orig_path + 7);
>  			if (!path) {
>  				fprintf(stderr, "%s doesn't contain a path\n",
> -					path + 7);
> +					orig_path + 7);
>  				exit(1);
>  			}
>  		}
> -- 
> 2.20.1
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux