From 1f1845d435fd0886f5c5561df8922268d2dfaefc Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 5 Oct 2020 16:09:00 +0100 Subject: Fix compile time error building windmc, detected by gcc 11. PR 26698 * windmc.c (mc_unify_path): Fix typo checking character at end of pathname. --- binutils/windmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'binutils/windmc.c') diff --git a/binutils/windmc.c b/binutils/windmc.c index 98bb3ad..3b9d2aa 100644 --- a/binutils/windmc.c +++ b/binutils/windmc.c @@ -924,7 +924,7 @@ mc_unify_path (const char *path) hsz = xmalloc (strlen (path) + 2); strcpy (hsz, path); end = hsz + strlen (hsz); - if (hsz[-1] != '/' && hsz[-1] != '\\') + if (end[-1] != '/' && end[-1] != '\\') strcpy (end, "/"); while ((end = strchr (hsz, '\\')) != NULL) *end = '/'; -- cgit v1.1