aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libpam/include/security/_pam_macros.h24
-rw-r--r--libpam/pam_dispatch.c4
-rw-r--r--libpam/pam_private.h14
3 files changed, 21 insertions, 21 deletions
diff --git a/libpam/include/security/_pam_macros.h b/libpam/include/security/_pam_macros.h
index cd42bf72..d01f51f5 100644
--- a/libpam/include/security/_pam_macros.h
+++ b/libpam/include/security/_pam_macros.h
@@ -34,7 +34,7 @@ do { \
PAM_DEPRECATED register char *xx_; \
register unsigned int i_ = 0; \
if ((xx_=(x))) \
- for (;i_<n; i_++) \
+ for (;i_<(n); i_++) \
xx_[i_] = 0; \
} while (0)
@@ -45,7 +45,7 @@ do { \
#define _pam_drop(X) \
do { \
free(X); \
- X=NULL; \
+ (X)=NULL; \
} while (0)
/*
@@ -53,16 +53,16 @@ do { \
*/
#define _pam_drop_reply(/* struct pam_response * */ reply, /* int */ replies) \
-do { \
- PAM_DEPRECATED int reply_i; \
- \
- for (reply_i=0; reply_i<replies; ++reply_i) { \
- if (reply[reply_i].resp) { \
- _pam_overwrite(reply[reply_i].resp); \
- free(reply[reply_i].resp); \
- } \
- } \
- free(reply); \
+do { \
+ PAM_DEPRECATED int reply_i; \
+ \
+ for (reply_i=0; reply_i<(replies); ++reply_i) { \
+ if ((reply)[reply_i].resp) { \
+ _pam_overwrite((reply)[reply_i].resp); \
+ free((reply)[reply_i].resp); \
+ } \
+ } \
+ free(reply); \
} while (0)
/* some debugging code */
diff --git a/libpam/pam_dispatch.c b/libpam/pam_dispatch.c
index 60ec85bd..3a1d59e8 100644
--- a/libpam/pam_dispatch.c
+++ b/libpam/pam_dispatch.c
@@ -18,8 +18,8 @@
/* impression codes - this gives some sense to the logical choices */
#define _PAM_UNDEF 0
-#define _PAM_POSITIVE +1
-#define _PAM_NEGATIVE -1
+#define _PAM_POSITIVE (+1)
+#define _PAM_NEGATIVE (-1)
/* frozen chain required codes */
#define _PAM_PLEASE_FREEZE 0
diff --git a/libpam/pam_private.h b/libpam/pam_private.h
index f9dd6223..77dc5a69 100644
--- a/libpam/pam_private.h
+++ b/libpam/pam_private.h
@@ -48,7 +48,7 @@
/* components of the pam_handle structure */
-#define _PAM_INVALID_RETVAL -1 /* default value for cached_retval */
+#define _PAM_INVALID_RETVAL (-1) /* default value for cached_retval */
struct handler {
int handler_type;
@@ -193,14 +193,14 @@ struct pam_handle {
#define _PAM_ACTION_IS_JUMP(x) ((x) > 0)
#define _PAM_ACTION_IGNORE 0
-#define _PAM_ACTION_OK -1
-#define _PAM_ACTION_DONE -2
-#define _PAM_ACTION_BAD -3
-#define _PAM_ACTION_DIE -4
-#define _PAM_ACTION_RESET -5
+#define _PAM_ACTION_OK (-1)
+#define _PAM_ACTION_DONE (-2)
+#define _PAM_ACTION_BAD (-3)
+#define _PAM_ACTION_DIE (-4)
+#define _PAM_ACTION_RESET (-5)
/* Add any new entries here. Will need to change ..._UNDEF and then
* need to change pam_tokens.h */
-#define _PAM_ACTION_UNDEF -6 /* this is treated as an error
+#define _PAM_ACTION_UNDEF (-6) /* this is treated as an error
( = _PAM_ACTION_BAD) */
#define PAM_SUBSTACK_MAX_LEVEL 16 /* maximum level of substacks */