diff options
author | Stefan Schubert <schubi@suse.de> | 2022-02-17 09:48:14 +0100 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2022-02-21 14:34:02 +0000 |
commit | 2f289878b6a7bd888fdfcfe4286b87006074da11 (patch) | |
tree | 0d3f20c10062e9e98d6e24a4a7b21a64672899bc /modules | |
parent | 370064ef6f99581b08d473a42bb3417d5dda3e4e (diff) | |
download | pam-2f289878b6a7bd888fdfcfe4286b87006074da11.tar.gz pam-2f289878b6a7bd888fdfcfe4286b87006074da11.tar.bz2 pam-2f289878b6a7bd888fdfcfe4286b87006074da11.zip |
pam_time: fix clang compilation warning
Fix the following compilation warning reported by clang:
"result of comparison against a string literal is unspecified
(use strcmp instead)".
* pam_time.c (_pam_parse): Do not compare char* string with a constant.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/pam_time/pam_time.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/pam_time/pam_time.c b/modules/pam_time/pam_time.c index b99e4c32..9092597a 100644 --- a/modules/pam_time/pam_time.c +++ b/modules/pam_time/pam_time.c @@ -58,7 +58,7 @@ _pam_parse (const pam_handle_t *pamh, int argc, const char **argv, const char ** { int ctrl = 0; - *conffile = PAM_TIME_CONF; + *conffile = NULL; /* step through arguments */ for (; argc-- > 0; ++argv) { const char *str; @@ -82,8 +82,9 @@ _pam_parse (const pam_handle_t *pamh, int argc, const char **argv, const char ** } } + if (*conffile == NULL) { + *conffile = PAM_TIME_CONF; #ifdef VENDOR_PAM_TIME_CONF - if (*conffile == PAM_TIME_CONF) { /* * Check whether PAM_TIME_CONF file is available. * If it does not exist, fall back to VENDOR_PAM_TIME_CONF file. @@ -92,8 +93,8 @@ _pam_parse (const pam_handle_t *pamh, int argc, const char **argv, const char ** if (stat(*conffile, &buffer) != 0 && errno == ENOENT) { *conffile = VENDOR_PAM_TIME_CONF; } - } #endif + } return ctrl; } |