]> granicus.if.org Git - yasm/commitdiff
strcmp() returns 0 if the strings are equal.
authorPeter Johnson <peter@tortall.net>
Sun, 2 Dec 2001 23:23:12 +0000 (23:23 -0000)
committerPeter Johnson <peter@tortall.net>
Sun, 2 Dec 2001 23:23:12 +0000 (23:23 -0000)
svn path=/trunk/yasm/; revision=382

libyasm/file.c
src/file.c

index 54c5534a9c7dfb7d0237509d5a4df16495ea6b5a..21a8f556fa7e191eba771c9dc4ca201b15b985ee 100644 (file)
@@ -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);
index 54c5534a9c7dfb7d0237509d5a4df16495ea6b5a..21a8f556fa7e191eba771c9dc4ca201b15b985ee 100644 (file)
@@ -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);