r16554: Sorry, just had to change this. Don't use int when
authorJeremy Allison <jra@samba.org>
Tue, 27 Jun 2006 03:59:34 +0000 (03:59 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:19:00 +0000 (11:19 -0500)
you're passing a BOOL parameter, don't use "clever"
code in while statement - make things easier and
clearer to understand when triggering something
with an if.
Jeremy.

source/lib/util_str.c

index 0248ad63ad86441175194a815646a56d29767454..8e0f2765ebb30c75380e61c580139ce2ce2fa5b7 100644 (file)
@@ -40,7 +40,7 @@ static BOOL next_token_internal(const char **ptr,
                                 char *buff,
                                 const char *sep,
                                 size_t bufsize,
-                                int ltrim)
+                                BOOL ltrim)
 {
        char *s;
        char *pbuf;
@@ -57,8 +57,10 @@ static BOOL next_token_internal(const char **ptr,
                sep = " \t\n\r";
 
        /* find the first non sep char, if left-trimming is requested */
-       while (ltrim && *s && strchr_m(sep,*s))
-               s++;
+       if (ltrim) {
+               while (*s && strchr_m(sep,*s))
+                       s++;
+       }
        
        /* nothing left? */
        if (! *s)