From b79773d3c71182c981af7dbf14b775bb83be52c8 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 5 Oct 1998 12:35:30 +0000 Subject: - fixed cast warnings - ignore *.po32 files (This used to be commit 469474803d39ceec7155792d364787318708fb91) --- source3/lib/util.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'source3/lib/util.c') diff --git a/source3/lib/util.c b/source3/lib/util.c index d079f86988..c1307336cc 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -2334,21 +2334,23 @@ int name_extract(char *buf,int ofs,char *name) /**************************************************************************** return the total storage length of a mangled name ****************************************************************************/ -int name_len(unsigned char *s) +int name_len(char *s1) { - int len; + /* NOTE: this argument _must_ be unsigned */ + unsigned char *s = (unsigned char *)s1; + int len; - /* If the two high bits of the byte are set, return 2. */ - if (0xC0 == (*s & 0xC0)) - return(2); + /* If the two high bits of the byte are set, return 2. */ + if (0xC0 == (*s & 0xC0)) + return(2); - /* Add up the length bytes. */ - for (len = 1; (*s); s += (*s) + 1) { - len += *s + 1; - SMB_ASSERT(len < 80); - } + /* Add up the length bytes. */ + for (len = 1; (*s); s += (*s) + 1) { + len += *s + 1; + SMB_ASSERT(len < 80); + } - return(len); + return(len); } /* name_len */ /**************************************************************************** -- cgit