From a03bd94204a1d71e63c0cca72f37596eda4ad572 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 24 May 2024 18:41:12 +0200 Subject: [PATCH] winegcc: Don't print a potentially reallocated pointer. --- tools/winegcc/utils.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/winegcc/utils.c b/tools/winegcc/utils.c index f79bfdf5877..65882758a7f 100644 --- a/tools/winegcc/utils.c +++ b/tools/winegcc/utils.c @@ -199,13 +199,14 @@ const char *find_binary( struct strarray prefix, const char *name ) int spawn(struct strarray prefix, struct strarray args, int ignore_errors) { int status; + const char *cmd; - args.str[0] = find_binary( prefix, args.str[0] ); + cmd = args.str[0] = find_binary( prefix, args.str[0] ); if (verbose) strarray_trace( args ); if ((status = strarray_spawn( args )) && !ignore_errors) { - if (status > 0) error("%s failed\n", args.str[0]); + if (status > 0) error("%s failed\n", cmd); else perror("winegcc"); exit(3); }