From 0c88eedbeba3da627e712021a2811b01f323c16e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 19 Jun 2006 23:19:24 +0000 Subject: r16375: Klocwork #1670. Jeremy. (This used to be commit 99605ce296663b7697d737fd521f0e4d8436d1f2) --- source3/lib/util_str.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source3') diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c index df84fa90a5..6fe1668e88 100644 --- a/source3/lib/util_str.c +++ b/source3/lib/util_str.c @@ -2250,15 +2250,21 @@ SMB_BIG_UINT STR_TO_SMB_BIG_UINT(const char *nptr, const char **entptr) SMB_BIG_UINT val = -1; const char *p = nptr; - while (p && *p && isspace(*p)) + if (!p) { + *entptr = p; + return val; + } + + while (*p && isspace(*p)) p++; + #ifdef LARGE_SMB_OFF_T sscanf(p,"%llu",&val); #else /* LARGE_SMB_OFF_T */ sscanf(p,"%lu",&val); #endif /* LARGE_SMB_OFF_T */ if (entptr) { - while (p && *p && isdigit(*p)) + while (*p && isdigit(*p)) p++; *entptr = p; } -- cgit