mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] scripts/rsatoc: fix printing of error message, if environment variable doen't contain a path
@ 2020-07-29 11:12 Marc Kleine-Budde
  2020-08-03 19:18 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Marc Kleine-Budde @ 2020-07-29 11:12 UTC (permalink / raw)
  To: barebox; +Cc: lst, sha

Fixes: 128ad3cbe043 ("scripts: Add rsatoc tool")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 scripts/rsatoc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

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


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] scripts/rsatoc: fix printing of error message, if environment variable doen't contain a path
  2020-07-29 11:12 [PATCH] scripts/rsatoc: fix printing of error message, if environment variable doen't contain a path Marc Kleine-Budde
@ 2020-08-03 19:18 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2020-08-03 19:18 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: barebox, lst

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@pengutronix.de>
> ---
>  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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-03 19:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-29 11:12 [PATCH] scripts/rsatoc: fix printing of error message, if environment variable doen't contain a path Marc Kleine-Budde
2020-08-03 19:18 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox