Correct pointer comparisons relying on NULL less than any other pointer.

Alexander Aganichev's fix for ieee.c
This commit is contained in:
Alan Modra
2000-06-20 12:33:21 +00:00
parent b305ef96a1
commit 2ab47eed68
10 changed files with 42 additions and 14 deletions

View File

@@ -219,7 +219,7 @@ make_tempname (filename)
{
/* We could have foo/bar\\baz, or foo\\bar, or d:bar. */
char *bslash = strrchr (filename, '\\');
if (bslash > slash)
if (slash == NULL || (bslash != NULL && bslash > slash))
slash = bslash;
if (slash == NULL && filename[0] != '\0' && filename[1] == ':')
slash = filename + 1;