]> git.sur5r.net Git - openldap/blobdiff - libraries/liblutil/base64.c
All implementations of lutil_lockf (aka ldap_lockf) block until
[openldap] / libraries / liblutil / base64.c
index 6f4b88fe8d985c779261c44955c727b690d9c5c7..96a6b284223b275da67b70ef75d22fdbfc1ff231 100644 (file)
@@ -48,6 +48,7 @@
 
 #include <stdlib.h>
 #include <stddef.h>
+#include <ctype.h>
 
 #include <ac/string.h>
 
@@ -126,7 +127,7 @@ static const char Pad64 = '=';
    */
 
 int
-b64_ntop(
+lutil_b64_ntop(
        u_char const *src,
        size_t srclength,
        char *target,
@@ -197,7 +198,7 @@ b64_ntop(
  */
 
 int
-b64_pton(
+lutil_b64_pton(
        char const *src,
        u_char *target, 
        size_t targsize)
@@ -209,7 +210,7 @@ b64_pton(
        tarindex = 0;
 
        while ((ch = *src++) != '\0') {
-               if (isspace(ch))        /* Skip whitespace anywhere. */
+               if (isascii(ch) && isspace(ch)) /* Skip whitespace anywhere. */
                        continue;
 
                if (ch == Pad64)
@@ -279,7 +280,7 @@ b64_pton(
                case 2:         /* Valid, means one byte of info */
                        /* Skip any number of spaces. */
                        for ((void)NULL; ch != '\0'; ch = *src++)
-                               if (!isspace(ch))
+                               if (! (isascii(ch) && isspace(ch)))
                                        break;
                        /* Make sure there is another trailing = sign. */
                        if (ch != Pad64)
@@ -294,7 +295,7 @@ b64_pton(
                         * whitespace after it?
                         */
                        for ((void)NULL; ch != '\0'; ch = *src++)
-                               if (!isspace(ch))
+                               if (! (isascii(ch) && isspace(ch)))
                                        return (-1);
 
                        /*