From bee9fda243f43b63ad460081b72316c172303541 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 7 Jun 2009 19:08:52 +0200 Subject: [PATCH] Add tldap_pull_uint32 --- source3/include/tldap_util.h | 2 ++ source3/lib/tldap_util.c | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/source3/include/tldap_util.h b/source3/include/tldap_util.h index 2d5cf57a9c70..1c993769d76d 100644 --- a/source3/include/tldap_util.h +++ b/source3/include/tldap_util.h @@ -49,5 +49,7 @@ int tldap_search_fmt(struct tldap_context *ld, const char *base, int scope, const char *fmt, ...); bool tldap_pull_uint64(struct tldap_message *msg, const char *attr, uint64_t *presult); +bool tldap_pull_uint32(struct tldap_message *msg, const char *attr, + uint32_t *presult); #endif diff --git a/source3/lib/tldap_util.c b/source3/lib/tldap_util.c index 1f2cc1d8de88..1b0c3446ee63 100644 --- a/source3/lib/tldap_util.c +++ b/source3/lib/tldap_util.c @@ -349,3 +349,15 @@ bool tldap_pull_uint64(struct tldap_message *msg, const char *attr, *presult = result; return true; } + +bool tldap_pull_uint32(struct tldap_message *msg, const char *attr, + uint32_t *presult) +{ + uint64_t result; + + if (!tldap_pull_uint64(msg, attr, &result)) { + return false; + } + *presult = (uint32_t)result; + return true; +} -- 2.34.1