From afb0fb4f7bb7fbec8a547397532852c29148b612 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 17 Oct 2006 17:34:42 +0200 Subject: [PATCH] Don't compare with a literal Don't compare a pointer with a string literal. Use strcmp instead. --- envy24control/profiles.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/envy24control/profiles.c b/envy24control/profiles.c index 7f5e918..443e475 100644 --- a/envy24control/profiles.c +++ b/envy24control/profiles.c @@ -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); -- 2.47.1