From 0f29f0af965358fc71d9f015376c2b51e04d03be Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Fri, 6 Jun 2003 13:50:01 +0000 Subject: [PATCH] #define *_OPT_ON &ber_pvt_opt_on. The old (void*)1 definition could be == NULL. --- include/lber.h | 3 ++- include/ldap.h | 2 +- libraries/liblber/options.c | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/lber.h b/include/lber.h index 5db9fb39f3..c01b3acc04 100644 --- a/include/lber.h +++ b/include/lber.h @@ -149,7 +149,8 @@ typedef struct lber_memory_fns { #define LBER_OPT_SOCKBUF_DEBUG 0x1002 /* on/off values */ -#define LBER_OPT_ON ((void *) 1) +extern char ber_pvt_opt_on; +#define LBER_OPT_ON ((void *) &ber_pvt_opt_on) #define LBER_OPT_OFF ((void *) 0) #define LBER_OPT_SUCCESS (0) diff --git a/include/ldap.h b/include/ldap.h index 6b3fcf1423..e28755214c 100644 --- a/include/ldap.h +++ b/include/ldap.h @@ -144,7 +144,7 @@ LDAP_BEGIN_DECL #define LDAP_OPT_X_SASL_MAXBUFSIZE 0x6109 /* on/off values */ -#define LDAP_OPT_ON ((void *) 1) +#define LDAP_OPT_ON ((void *) &ber_pvt_opt_on) #define LDAP_OPT_OFF ((void *) 0) /* diff --git a/libraries/liblber/options.c b/libraries/liblber/options.c index f59dcc1393..d2371567e7 100644 --- a/libraries/liblber/options.c +++ b/libraries/liblber/options.c @@ -10,6 +10,8 @@ #include #include "lber-int.h" +char ber_pvt_opt_on; /* used to get a non-NULL address for *_OPT_ON */ + struct lber_options ber_int_options = { LBER_UNINITIALIZED, 0, 0, 0 }; -- 2.39.5