mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: barebox@lists.infradead.org
Cc: lst@pengutronix.de, sha@pengutronix.de
Subject: [PATCH] scripts/rsatoc: fix printing of error message, if environment variable doen't contain a path
Date: Wed, 29 Jul 2020 13:12:40 +0200	[thread overview]
Message-ID: <20200729111240.24702-1-mkl@pengutronix.de> (raw)

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

             reply	other threads:[~2020-07-29 11:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-29 11:12 Marc Kleine-Budde [this message]
2020-08-03 19:18 ` Sascha Hauer

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=20200729111240.24702-1-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=lst@pengutronix.de \
    --cc=sha@pengutronix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox