From: Pierangelo Masarati Date: Sat, 15 Dec 2007 15:23:23 +0000 (+0000) Subject: fix declarations of buffers for numeric strings; other related cleanup X-Git-Tag: OPENLDAP_REL_ENG_2_4_9~20^2~299 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=20f2548c82e073b82733f18794d0bc0f5cfe5852;p=openldap fix declarations of buffers for numeric strings; other related cleanup --- diff --git a/contrib/slapd-modules/smbk5pwd/smbk5pwd.c b/contrib/slapd-modules/smbk5pwd/smbk5pwd.c index 564ca10fbe..78bc1daec6 100644 --- a/contrib/slapd-modules/smbk5pwd/smbk5pwd.c +++ b/contrib/slapd-modules/smbk5pwd/smbk5pwd.c @@ -532,9 +532,9 @@ static int smbk5pwd_exop_passwd( qpw->rs_mods = ml; keys = ch_malloc( 2 * sizeof(struct berval) ); - keys[0].bv_val = ch_malloc( STRLENOF( "9223372036854775807L" ) + 1 ); + keys[0].bv_val = ch_malloc( LDAP_PVT_INTTYPE_CHARS(long) ); keys[0].bv_len = snprintf(keys[0].bv_val, - STRLENOF( "9223372036854775807L" ) + 1, + LDAP_PVT_INTTYPE_CHARS(long), "%ld", slap_get_time()); BER_BVZERO( &keys[1] ); @@ -554,9 +554,9 @@ static int smbk5pwd_exop_passwd( qpw->rs_mods = ml; keys = ch_malloc( 2 * sizeof(struct berval) ); - keys[0].bv_val = ch_malloc( STRLENOF( "9223372036854775807L" ) + 1 ); + keys[0].bv_val = ch_malloc( LDAP_PVT_INTTYPE_CHARS(long) ); keys[0].bv_len = snprintf(keys[0].bv_val, - STRLENOF( "9223372036854775807L" ) + 1, + LDAP_PVT_INTTYPE_CHARS(long), "%ld", slap_get_time() + pi->smb_must_change); BER_BVZERO( &keys[1] ); @@ -577,9 +577,9 @@ static int smbk5pwd_exop_passwd( qpw->rs_mods = ml; keys = ch_malloc( 2 * sizeof(struct berval) ); - keys[0].bv_val = ch_malloc( STRLENOF( "9223372036854775807L" ) + 1 ); + keys[0].bv_val = ch_malloc( LDAP_PVT_INTTYPE_CHARS(long) ); keys[0].bv_len = snprintf(keys[0].bv_val, - STRLENOF( "9223372036854775807L" ) + 1, + LDAP_PVT_INTTYPE_CHARS(long), "%ld", slap_get_time() + pi->smb_can_change); BER_BVZERO( &keys[1] ); diff --git a/include/ldap_pvt.h b/include/ldap_pvt.h index 1506983757..73eba3190c 100644 --- a/include/ldap_pvt.h +++ b/include/ldap_pvt.h @@ -169,7 +169,7 @@ LDAP_F( int ) ldap_bv2rdn_x LDAP_P(( struct berval *, LDAPRDN *, char **, unsigned flags, void *ctx )); LDAP_F( int ) ldap_rdn2bv_x LDAP_P(( LDAPRDN rdn, struct berval *bv, unsigned flags, void *ctx )); -#endif +#endif /* LDAP_AVA_NULL */ /* url.c */ LDAP_F (void) ldap_pvt_hex_unescape LDAP_P(( char *s )); @@ -225,7 +225,7 @@ LDAP_F (void) ldap_pvt_sasl_remove LDAP_P(( struct sockbuf * )); #ifndef LDAP_PVT_SASL_LOCAL_SSF #define LDAP_PVT_SASL_LOCAL_SSF 71 /* SSF for Unix Domain Sockets */ -#endif +#endif /* ! LDAP_PVT_SASL_LOCAL_SSF */ struct ldap; struct ldapmsg; @@ -316,6 +316,8 @@ LDAP_END_DECL * If none is available, unsigned long data is used. */ +LDAP_BEGIN_DECL + #ifdef USE_MP_BIGNUM /* * Use OpenSSL's BIGNUM @@ -404,4 +406,15 @@ typedef unsigned long ldap_pvt_mp_t; #include "ldap_pvt_uc.h" +LDAP_END_DECL + +LDAP_BEGIN_DECL + +#include /* get CHAR_BIT */ + +/* Buffer space for sign, decimal digits and \0. Note: log10(2) < 146/485. */ +#define LDAP_PVT_INTTYPE_CHARS(type) (((sizeof(type)*CHAR_BIT-1)*146)/485 + 3) + +LDAP_END_DECL + #endif /* _LDAP_PVT_H */ diff --git a/libraries/libldap/url.c b/libraries/libldap/url.c index 6a6e076b56..4ef41f5ef4 100644 --- a/libraries/libldap/url.c +++ b/libraries/libldap/url.c @@ -582,7 +582,7 @@ desc2str_len( LDAPURLDesc *u ) len += sep; if ( u->lud_port ) { - char buf[] = ":65535"; + char buf[ STRLENOF(":65535") + 1 ]; len += snprintf( buf, sizeof( buf ), ":%d", u->lud_port ); if ( u->lud_host && u->lud_host[0] ) { diff --git a/libraries/liblutil/utils.c b/libraries/liblutil/utils.c index ff711da018..0e1068653c 100644 --- a/libraries/liblutil/utils.c +++ b/libraries/liblutil/utils.c @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -885,3 +886,53 @@ lutil_unparse_time( return 0; } +/* + * formatted print to string + * + * - if return code < 0, the error code returned by vsnprintf(3) is returned + * + * - if return code > 0, the buffer was not long enough; + * - if next is not NULL, *next will be set to buf + bufsize - 1 + * - if len is not NULL, *len will contain the required buffer length + * + * - if return code == 0, the buffer was long enough; + * - if next is not NULL, *next will point to the end of the string printed so far + * - if len is not NULL, *len will contain the length of the string printed so far + */ +int +lutil_snprintf( char *buf, ber_len_t bufsize, char **next, ber_len_t *len, LDAP_CONST char *fmt, ... ) +{ + va_list ap; + int ret; + + assert( buf != NULL ); + assert( bufsize > 0 ); + assert( fmt != NULL ); + + va_start( ap, fmt ); + ret = vsnprintf( buf, bufsize, fmt, ap ); + va_end( ap ); + + if ( ret < 0 ) { + return ret; + } + + if ( len ) { + *len = ret; + } + + if ( ret >= bufsize ) { + if ( next ) { + *next = &buf[ bufsize - 1 ]; + } + + return 1; + } + + if ( next ) { + *next = &buf[ ret ]; + } + + return 0; +} + diff --git a/servers/slapd/acl.c b/servers/slapd/acl.c index a2b5d6f44b..0ff7b38928 100644 --- a/servers/slapd/acl.c +++ b/servers/slapd/acl.c @@ -1280,7 +1280,7 @@ slap_acl_mask( /* extract IP and try exact match */ } else if ( b->a_peername_style == ACL_STYLE_IP ) { char *port; - char buf[] = "255.255.255.255"; + char buf[STRLENOF("255.255.255.255") + 1]; struct berval ip; unsigned long addr; int port_number = -1; @@ -1325,7 +1325,7 @@ slap_acl_mask( /* extract IPv6 and try exact match */ } else if ( b->a_peername_style == ACL_STYLE_IPV6 ) { char *port; - char buf[] = "FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF"; + char buf[STRLENOF("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF") + 1]; struct berval ip; struct in6_addr addr; int port_number = -1; diff --git a/servers/slapd/aclparse.c b/servers/slapd/aclparse.c index 37db9afd7f..22d2388853 100644 --- a/servers/slapd/aclparse.c +++ b/servers/slapd/aclparse.c @@ -39,7 +39,7 @@ #include "lutil.h" static const char style_base[] = "base"; -char *style_strings[] = { +const char *style_strings[] = { "regex", "expand", "exact", diff --git a/servers/slapd/back-monitor/conn.c b/servers/slapd/back-monitor/conn.c index aeaa61f529..64406d4b29 100644 --- a/servers/slapd/back-monitor/conn.c +++ b/servers/slapd/back-monitor/conn.c @@ -236,7 +236,7 @@ monitor_subsys_conn_update( if ( n != -1 ) { Attribute *a; - char buf[] = "+9223372036854775807L"; + char buf[LDAP_PVT_INTTYPE_CHARS(long)]; ber_len_t len; a = attr_find( e->e_attrs, mi->mi_ad_monitorCounter ); diff --git a/servers/slapd/back-monitor/rww.c b/servers/slapd/back-monitor/rww.c index 652698889f..a99a1fd243 100644 --- a/servers/slapd/back-monitor/rww.c +++ b/servers/slapd/back-monitor/rww.c @@ -162,7 +162,7 @@ monitor_subsys_rww_update( struct berval nrdn; Attribute *a; - char buf[] = "+9223372036854775807L"; + char buf[LDAP_PVT_INTTYPE_CHARS(long)]; long num = 0; ber_len_t len; diff --git a/servers/slapd/back-sql/add.c b/servers/slapd/back-sql/add.c index 501c8bfd96..9c73cec371 100644 --- a/servers/slapd/back-sql/add.c +++ b/servers/slapd/back-sql/add.c @@ -794,7 +794,7 @@ backsql_add_attr( int prc = LDAP_SUCCESS; /* first parameter #, parameter order */ SQLUSMALLINT pno, po; - char logbuf[] = "val[18446744073709551615UL], id=18446744073709551615UL"; + char logbuf[ STRLENOF("val[], id=") + 2*LDAP_PVT_INTTYPE_CHARS(unsigned long)]; /* * Do not deal with the objectClass that is used diff --git a/servers/slapd/back-sql/config.c b/servers/slapd/back-sql/config.c index db1170c884..d24be62c76 100644 --- a/servers/slapd/back-sql/config.c +++ b/servers/slapd/back-sql/config.c @@ -540,8 +540,8 @@ backsql_db_config( 0, 0 ); } else if ( !strcasecmp( argv[ 0 ], "fetch_attrs" ) ) { - char *str, *s, *next; - char delimstr[] = ","; + char *str, *s, *next; + const char *delimstr = ","; if ( argc < 2 ) { Debug( LDAP_DEBUG_TRACE, @@ -761,10 +761,10 @@ create_baseObject( "objectClass: extensibleObject\n" "description: builtin baseObject for back-sql\n" "description: all entries mapped " - "in the \"ldap_entries\" table\n" - "description: must have " - "\"" BACKSQL_BASEOBJECT_IDSTR "\" " - "in the \"parent\" column", + "in table \"ldap_entries\" " + "must have " + "\"" BACKSQL_BASEOBJECT_IDSTR "\" " + "in the \"parent\" column", be->be_suffix[0].bv_val ); bi->sql_baseObject = str2entry( buf ); diff --git a/servers/slapd/back-sql/proto-sql.h b/servers/slapd/back-sql/proto-sql.h index 3af14d5ee0..d9d01777ca 100644 --- a/servers/slapd/back-sql/proto-sql.h +++ b/servers/slapd/back-sql/proto-sql.h @@ -235,7 +235,7 @@ int backsql_free_db_conn( Operation *op, SQLHDBC dbh ); * util.c */ -extern char +extern const char backsql_def_oc_query[], backsql_def_needs_select_oc_query[], backsql_def_at_query[], @@ -246,8 +246,7 @@ extern char backsql_def_subtree_cond[], backsql_def_upper_subtree_cond[], backsql_id_query[], - backsql_def_concat_func[]; -extern char + backsql_def_concat_func[], backsql_check_dn_ru_query[]; struct berbuf * backsql_strcat_x( struct berbuf *dest, void *memctx, ... ); diff --git a/servers/slapd/back-sql/schema-map.c b/servers/slapd/back-sql/schema-map.c index 98424c6aa9..6959e07157 100644 --- a/servers/slapd/back-sql/schema-map.c +++ b/servers/slapd/back-sql/schema-map.c @@ -189,7 +189,7 @@ static int backsql_add_sysmaps( backsql_info *bi, backsql_oc_map_rec *oc_map ) { backsql_at_map_rec *at_map; - char s[] = "+9223372036854775807L"; + char s[LDAP_PVT_INTTYPE_CHARS(long)]; struct berval sbv; struct berbuf bb; @@ -228,13 +228,11 @@ backsql_add_sysmaps( backsql_info *bi, backsql_oc_map_rec *oc_map ) at_map->bam_add_proc = NULL; { - char tmp[] = - "INSERT INTO ldap_entry_objclasses " + char tmp[STRLENOF("INSERT INTO ldap_entry_objclasses " "(entry_id,oc_name) VALUES " "((SELECT id FROM ldap_entries " - "WHERE oc_map_id=" - "18446744073709551615UL " /* 64 bit ULONG */ - "AND keyval=?),?)"; + "WHERE oc_map_id= " + "AND keyval=?),?)") + LDAP_PVT_INTTYPE_CHARS(unsigned long)]; snprintf( tmp, sizeof(tmp), "INSERT INTO ldap_entry_objclasses " "(entry_id,oc_name) VALUES " @@ -246,12 +244,10 @@ backsql_add_sysmaps( backsql_info *bi, backsql_oc_map_rec *oc_map ) at_map->bam_delete_proc = NULL; { - char tmp[] = - "DELETE FROM ldap_entry_objclasses " + char tmp[STRLENOF("DELETE FROM ldap_entry_objclasses " "WHERE entry_id=(SELECT id FROM ldap_entries " - "WHERE oc_map_id=" - "18446744073709551615UL " /* 64 bit ULONG */ - "AND keyval=?) AND oc_name=?"; + "WHERE oc_map_id= " + "AND keyval=?) AND oc_name=?") + LDAP_PVT_INTTYPE_CHARS(unsigned long)]; snprintf( tmp, sizeof(tmp), "DELETE FROM ldap_entry_objclasses " "WHERE entry_id=(SELECT id FROM ldap_entries " diff --git a/servers/slapd/back-sql/search.c b/servers/slapd/back-sql/search.c index 0da8590cd4..2437448055 100644 --- a/servers/slapd/back-sql/search.c +++ b/servers/slapd/back-sql/search.c @@ -864,7 +864,7 @@ backsql_process_filter( backsql_srch_info *bsi, Filter *f ) struct berval keyval; #else /* ! BACKSQL_ARBITRARY_KEY */ unsigned long keyval; - char keyvalbuf[] = "18446744073709551615"; + char keyvalbuf[LDAP_PVT_INTTYPE_CHARS(unsigned long)]; #endif /* ! BACKSQL_ARBITRARY_KEY */ switch ( f->f_choice ) { diff --git a/servers/slapd/back-sql/util.c b/servers/slapd/back-sql/util.c index b3c319d570..6d323dc2b0 100644 --- a/servers/slapd/back-sql/util.c +++ b/servers/slapd/back-sql/util.c @@ -37,32 +37,32 @@ #define BACKSQL_STR_GROW 256 -char backsql_def_oc_query[] = +const char backsql_def_oc_query[] = "SELECT id,name,keytbl,keycol,create_proc,delete_proc,expect_return " "FROM ldap_oc_mappings"; -char backsql_def_needs_select_oc_query[] = +const char backsql_def_needs_select_oc_query[] = "SELECT id,name,keytbl,keycol,create_proc,create_keyval,delete_proc," "expect_return FROM ldap_oc_mappings"; -char backsql_def_at_query[] = +const char backsql_def_at_query[] = "SELECT name,sel_expr,from_tbls,join_where,add_proc,delete_proc," "param_order,expect_return,sel_expr_u FROM ldap_attr_mappings " "WHERE oc_map_id=?"; -char backsql_def_delentry_stmt[] = "DELETE FROM ldap_entries WHERE id=?"; -char backsql_def_renentry_stmt[] = +const char backsql_def_delentry_stmt[] = "DELETE FROM ldap_entries WHERE id=?"; +const char backsql_def_renentry_stmt[] = "UPDATE ldap_entries SET dn=?,parent=?,keyval=? WHERE id=?"; -char backsql_def_insentry_stmt[] = +const char backsql_def_insentry_stmt[] = "INSERT INTO ldap_entries (dn,oc_map_id,parent,keyval) " "VALUES (?,?,?,?)"; -char backsql_def_delobjclasses_stmt[] = "DELETE FROM ldap_entry_objclasses " +const char backsql_def_delobjclasses_stmt[] = "DELETE FROM ldap_entry_objclasses " "WHERE entry_id=?"; -char backsql_def_subtree_cond[] = "ldap_entries.dn LIKE CONCAT('%',?)"; -char backsql_def_upper_subtree_cond[] = "(ldap_entries.dn) LIKE CONCAT('%',?)"; -char backsql_id_query[] = "SELECT id,keyval,oc_map_id,dn FROM ldap_entries WHERE "; +const char backsql_def_subtree_cond[] = "ldap_entries.dn LIKE CONCAT('%',?)"; +const char backsql_def_upper_subtree_cond[] = "(ldap_entries.dn) LIKE CONCAT('%',?)"; +const char backsql_id_query[] = "SELECT id,keyval,oc_map_id,dn FROM ldap_entries WHERE "; /* better ?||? or cast(?||? as varchar) */ -char backsql_def_concat_func[] = "CONCAT(?,?)"; +const char backsql_def_concat_func[] = "CONCAT(?,?)"; /* TimesTen */ -char backsql_check_dn_ru_query[] = "SELECT dn_ru FROM ldap_entries"; +const char backsql_check_dn_ru_query[] = "SELECT dn_ru FROM ldap_entries"; struct berbuf * backsql_strcat_x( struct berbuf *dest, void *memctx, ... ) diff --git a/servers/slapd/config.h b/servers/slapd/config.h index 3664adcb82..61b2dc65b1 100644 --- a/servers/slapd/config.h +++ b/servers/slapd/config.h @@ -121,7 +121,7 @@ typedef struct config_args_s { char *tline; const char *fname; int lineno; - char log[MAXPATHLEN + STRLENOF(": line 18446744073709551615") + 1]; + char log[MAXPATHLEN + STRLENOF(": line ") + LDAP_PVT_INTTYPE_CHARS(unsigned long)]; #define cr_msg reply.msg ConfigReply reply; int depth; diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index 21d0eae8c7..d68c4bd79c 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -1058,7 +1058,7 @@ get_url_perms( S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH }; - static char c[] = "-rwxrwxrwx"; + static const char c[] = "-rwxrwxrwx"; if ( value[ j ] == c[ j ] ) { p |= m[ j ]; diff --git a/servers/slapd/overlays/dds.c b/servers/slapd/overlays/dds.c index d21876e8b6..e55a6510c2 100644 --- a/servers/slapd/overlays/dds.c +++ b/servers/slapd/overlays/dds.c @@ -395,7 +395,7 @@ dds_op_add( Operation *op, SlapReply *rs ) /* handle dynamic object operational attr(s) */ if ( is_dynamicObject ) { time_t ttl, expire; - char ttlbuf[] = "31557600"; + char ttlbuf[STRLENOF("31557600") + 1]; char tsbuf[ LDAP_LUTIL_GENTIME_BUFSIZE ]; struct berval bv; @@ -414,10 +414,12 @@ dds_op_add( Operation *op, SlapReply *rs ) ttl = DDS_DEFAULT_TTL( di ); + /* assert because should be checked at configure */ assert( ttl <= DDS_RF2589_MAX_TTL ); bv.bv_val = ttlbuf; bv.bv_len = snprintf( ttlbuf, sizeof( ttlbuf ), "%ld", ttl ); + assert( bv.bv_len < sizeof( ttlbuf ) ); /* FIXME: apparently, values in op->ora_e are malloc'ed * on the thread's slab; works fine by chance, @@ -1004,7 +1006,7 @@ dds_op_extended( Operation *op, SlapReply *rs ) slap_callback sc = { 0 }; Modifications ttlmod = { { 0 } }; struct berval ttlvalues[ 2 ]; - char ttlbuf[] = "31557600"; + char ttlbuf[STRLENOF("31557600") + 1]; rs->sr_err = slap_parse_refresh( op->ore_reqdata, NULL, &ttl, &rs->sr_text, NULL ); diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index 4e1684235a..214bdf8944 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -98,7 +98,7 @@ LDAP_SLAPD_F (int) acl_string_expand LDAP_P(( /* * aclparse.c */ -LDAP_SLAPD_V (char *) style_strings[]; +LDAP_SLAPD_V (LDAP_CONST char *) style_strings[]; LDAP_SLAPD_F (int) parse_acl LDAP_P(( Backend *be, const char *fname, int lineno, @@ -2039,7 +2039,7 @@ LDAP_SLAPD_F (int) fe_access_allowed LDAP_P(( # define UI2BVX(bv,ui,ctx) \ do { \ - char buf[] = "+9223372036854775807L"; \ + char buf[LDAP_PVT_INTTYPE_CHARS(long)]; \ ber_len_t len; \ len = snprintf( buf, sizeof( buf ), UI2BV_FORMAT, (ui) ); \ if ( len > (bv)->bv_len ) { \ diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 1ff340d2a6..20e2eb3ca6 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -2446,7 +2446,7 @@ typedef struct Opheader { slap_counters_t *oh_counters; - char oh_log_prefix[ /* sizeof("conn=18446744073709551615 op=18446744073709551615") */ SLAP_TEXT_BUFLEN ]; + char oh_log_prefix[ /* sizeof("conn= op=") + 2*LDAP_PVT_INTTYPE_CHARS(unsigned long) */ SLAP_TEXT_BUFLEN ]; #ifdef LDAP_SLAPI void *oh_extensions; /* NS-SLAPI plugin */ diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 2ba265a0f4..1b48d28deb 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -3522,7 +3522,7 @@ parse_syncrepl_line( si->si_anfile = attr_fname; } else { char *str, *s, *next; - char delimstr[] = " ,\t"; + const char *delimstr = " ,\t"; str = ch_strdup( val ); for ( s = ldap_pvt_strtok( str, delimstr, &next ); s != NULL; diff --git a/tests/progs/slapd-tester.c b/tests/progs/slapd-tester.c index da488372a3..331eaac9cd 100644 --- a/tests/progs/slapd-tester.c +++ b/tests/progs/slapd-tester.c @@ -140,7 +140,7 @@ main( int argc, char **argv ) int sextra_args = 0; char scmd[MAXPATHLEN]; /* static so that its address can be used in initializer below. */ - static char sloops[] = "18446744073709551615UL"; + static char sloops[LDAP_PVT_INTTYPE_CHARS(unsigned long)]; /* read */ char *rfile = NULL; char *rreqs[MAXREQS]; @@ -150,14 +150,14 @@ main( int argc, char **argv ) int ranum; int rextra_args = 0; char rcmd[MAXPATHLEN]; - static char rloops[] = "18446744073709551615UL"; + static char rloops[LDAP_PVT_INTTYPE_CHARS(unsigned long)]; /* addel */ char *afiles[MAXREQS]; int anum = 0; char *aargs[MAXARGS]; int aanum; char acmd[MAXPATHLEN]; - static char aloops[] = "18446744073709551615UL"; + static char aloops[LDAP_PVT_INTTYPE_CHARS(unsigned long)]; /* modrdn */ char *nfile = NULL; char *nreqs[MAXREQS]; @@ -165,7 +165,7 @@ main( int argc, char **argv ) char *nargs[MAXARGS]; int nanum; char ncmd[MAXPATHLEN]; - static char nloops[] = "18446744073709551615UL"; + static char nloops[LDAP_PVT_INTTYPE_CHARS(unsigned long)]; /* modify */ char *mfile = NULL; char *mreqs[MAXREQS]; @@ -174,7 +174,7 @@ main( int argc, char **argv ) char *margs[MAXARGS]; int manum; char mcmd[MAXPATHLEN]; - static char mloops[] = "18446744073709551615UL"; + static char mloops[LDAP_PVT_INTTYPE_CHARS(unsigned long)]; /* bind */ char *bfile = NULL; char *breqs[MAXREQS]; @@ -184,7 +184,7 @@ main( int argc, char **argv ) char *bargs[MAXARGS]; int banum; char bcmd[MAXPATHLEN]; - static char bloops[] = "18446744073709551615UL"; + static char bloops[LDAP_PVT_INTTYPE_CHARS(unsigned long)]; char **bargs_extra = NULL; char *friendlyOpt = NULL;