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.
This commit is contained in:
Nick Clifton 2020-10-05 16:09:00 +01:00
parent f9b1d75e91
commit 1f1845d435
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2020-10-05 Nick Clifton <nickc@redhat.com>
PR 26698
* windmc.c (mc_unify_path): Fix typo checking character at end of
pathname.
2020-10-05 Samanta Navarro <ferivoz@riseup.net>
* doc/binutils.texi: Fix spelling mistakes.

View File

@ -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 = '/';