diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-07-22 11:32:01 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:29:58 -0500 |
commit | f1418f62eecb3b62de92ce06f1a36b45e0a8dd8d (patch) | |
tree | 731bb10ec49aaef61889cb4c7b82c2ae5094c687 | |
parent | ab4f3a663ba0aa1292a447cdd22be4ecc4ac29c5 (diff) | |
download | samba-f1418f62eecb3b62de92ce06f1a36b45e0a8dd8d.tar.gz samba-f1418f62eecb3b62de92ce06f1a36b45e0a8dd8d.tar.bz2 samba-f1418f62eecb3b62de92ce06f1a36b45e0a8dd8d.zip |
r8715: - revert the %PRIi64 stuff. Tim, we explicitly check for %llu support
in configure, and replace snprintf if the system doesn't support
it. Our replacement code does not handle the "%PRIi64" stuff, so
using it would break us on lots of platforms
- fixed constant array initialisers to work on HPUX.
(This used to be commit c6bae3e87e2dcb3a89bbb32da131627c60871e3d)
-rw-r--r-- | source4/dsdb/samdb/samdb.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/source4/dsdb/samdb/samdb.c b/source4/dsdb/samdb/samdb.c index 68ece6c51d..ed8f5ab88f 100644 --- a/source4/dsdb/samdb/samdb.c +++ b/source4/dsdb/samdb/samdb.c @@ -88,9 +88,11 @@ const char *samdb_search_string_v(struct ldb_context *sam_ldb, const char *format, va_list ap) _PRINTF_ATTRIBUTE(5,0) { int count; - const char * const attrs[2] = { attr_name, NULL }; + const char *attrs[2] = { NULL, NULL }; struct ldb_message **res = NULL; + attrs[0] = attr_name; + count = gendb_search_v(sam_ldb, mem_ctx, basedn, &res, attrs, format, ap); if (count > 1) { DEBUG(1,("samdb: search for %s %s not single valued (count=%d)\n", @@ -136,9 +138,11 @@ struct dom_sid *samdb_search_dom_sid(struct ldb_context *sam_ldb, va_list ap; int count; struct ldb_message **res; - const char * const attrs[2] = { attr_name, NULL }; + const char *attrs[2] = { NULL, NULL }; struct dom_sid *sid; + attrs[0] = attr_name; + va_start(ap, format); count = gendb_search_v(sam_ldb, mem_ctx, basedn, &res, attrs, format, ap); va_end(ap); @@ -189,7 +193,9 @@ uint_t samdb_search_uint(struct ldb_context *sam_ldb, va_list ap; int count; struct ldb_message **res; - const char * const attrs[2] = { attr_name, NULL }; + const char *attrs[2] = { NULL, NULL }; + + attrs[0] = attr_name; va_start(ap, format); count = gendb_search_v(sam_ldb, mem_ctx, basedn, &res, attrs, format, ap); @@ -215,7 +221,9 @@ int64_t samdb_search_int64(struct ldb_context *sam_ldb, va_list ap; int count; struct ldb_message **res; - const char * const attrs[2] = { attr_name, NULL }; + const char *attrs[2] = { NULL, NULL }; + + attrs[0] = attr_name; va_start(ap, format); count = gendb_search_v(sam_ldb, mem_ctx, basedn, &res, attrs, format, ap); @@ -241,9 +249,11 @@ int samdb_search_string_multiple(struct ldb_context *sam_ldb, { va_list ap; int count, i; - const char * const attrs[2] = { attr_name, NULL }; + const char *attrs[2] = { NULL, NULL }; struct ldb_message **res = NULL; + attrs[0] = attr_name; + va_start(ap, format); count = gendb_search_v(sam_ldb, mem_ctx, basedn, &res, attrs, format, ap); va_end(ap); @@ -852,7 +862,7 @@ int samdb_msg_add_uint(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct int samdb_msg_add_int64(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct ldb_message *msg, const char *attr_name, int64_t v) { - const char *s = talloc_asprintf(mem_ctx, "%"PRIi64, v); + const char *s = talloc_asprintf(mem_ctx, "%lld", v); return samdb_msg_add_string(sam_ldb, mem_ctx, msg, attr_name, s); } @@ -862,7 +872,7 @@ int samdb_msg_add_int64(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct int samdb_msg_add_uint64(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct ldb_message *msg, const char *attr_name, uint64_t v) { - const char *s = talloc_asprintf(mem_ctx, "%"PRIu64, v); + const char *s = talloc_asprintf(mem_ctx, "%llu", v); return samdb_msg_add_string(sam_ldb, mem_ctx, msg, attr_name, s); } |