]> git.alsa-project.org Git - alsa-tools.git/commitdiff
Don't compare with a literal
authorTakashi Iwai <tiwai@suse.de>
Tue, 17 Oct 2006 15:34:42 +0000 (17:34 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 17 Oct 2006 15:34:42 +0000 (17:34 +0200)
Don't compare a pointer with a string literal.  Use strcmp instead.

envy24control/profiles.c

index 7f5e918c89bba664881b0d48c565f58ef7a7407a..443e4759936ed69a07a255094cc16480b274a35f 100644 (file)
@@ -71,9 +71,11 @@ int which_cfgfile(char ** const cfgfile)
        filename_without_tilde[MAX_FILE_NAME_LENGTH - 1] = '\0';
        subst_tilde_in_filename(filename_without_tilde);
        if ((inputFile = fopen(filename_without_tilde, "r")) == NULL) {
-               if ((*cfgfile != DEFAULT_PROFILERC) && (*cfgfile != SYS_PROFILERC)) {
+               if (strcmp(*cfgfile, DEFAULT_PROFILERC) &&
+                   strcmp(*cfgfile, SYS_PROFILERC)) {
                        res = -ENOENT;
-               } else if ((*cfgfile == DEFAULT_PROFILERC) && ((inputFile = fopen(SYS_PROFILERC, "r")) == NULL)) {
+               } else if (!strcmp(*cfgfile, DEFAULT_PROFILERC) &&
+                          (inputFile = fopen(SYS_PROFILERC, "r")) == NULL) {
                        res = -ENOENT;
                } else {
                        fclose(inputFile);