summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/util_str.c10
1 files changed, 8 insertions, 2 deletions
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;
}