From b2e37d9ce12627883ff18ab22ed9d3b6233f6baf Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 8 Apr 2011 12:55:28 +1000 Subject: lib/util ucs2_align is identical, put it in common Signed-off-by: Andrew Tridgell --- lib/util/util_str_common.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/util/util_str_common.c') diff --git a/lib/util/util_str_common.c b/lib/util/util_str_common.c index e003d73d74..9999ee440e 100644 --- a/lib/util/util_str_common.c +++ b/lib/util/util_str_common.c @@ -52,3 +52,10 @@ _PUBLIC_ int strwicmp(const char *psz1, const char *psz2) } return (*psz1 - *psz2); } + +_PUBLIC_ size_t ucs2_align(const void *base_ptr, const void *p, int flags) +{ + if (flags & (STR_NOALIGN|STR_ASCII)) + return 0; + return PTR_DIFF(p, base_ptr) & 1; +} -- cgit