From: Peter Johnson Date: Sun, 2 Dec 2001 23:23:12 +0000 (-0000) Subject: strcmp() returns 0 if the strings are equal. X-Git-Tag: v0.1.0~148 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f36a664a4929db96815bd16b6acdfd4d19c9d38e;p=yasm strcmp() returns 0 if the strings are equal. svn path=/trunk/yasm/; revision=382 --- diff --git a/libyasm/file.c b/libyasm/file.c index 54c5534a..21a8f556 100644 --- a/libyasm/file.c +++ b/libyasm/file.c @@ -41,7 +41,7 @@ replace_extension(const char *orig, const char *ext, const char *def) * (as we don't want to overwrite the source file). */ outext++; /* advance past '.' */ - if (strcmp(outext, ext)) { + if (strcmp(outext, ext) == 0) { outext = NULL; /* indicate default should be used */ WarningNow(_("file name already ends in `.%s': output will be in `%s'"), ext, def); diff --git a/src/file.c b/src/file.c index 54c5534a..21a8f556 100644 --- a/src/file.c +++ b/src/file.c @@ -41,7 +41,7 @@ replace_extension(const char *orig, const char *ext, const char *def) * (as we don't want to overwrite the source file). */ outext++; /* advance past '.' */ - if (strcmp(outext, ext)) { + if (strcmp(outext, ext) == 0) { outext = NULL; /* indicate default should be used */ WarningNow(_("file name already ends in `.%s': output will be in `%s'"), ext, def);