* IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#include <stdlib.h>
-#include <stddef.h>
-#include <string.h>
-#include <sys/types.h>
+#include "portable.h"
-#include <lutil.h>
+#include <ac/stdlib.h>
+#include <ac/ctype.h>
+#include <ac/string.h>
+
+/* include socket.h to get sys/types.h and/or winsock2.h */
+#include <ac/socket.h>
+
+#include "lutil.h"
#define Assert(Cond) if (!(Cond)) abort()
*/
int
-b64_ntop(
+lutil_b64_ntop(
u_char const *src,
size_t srclength,
char *target,
*/
int
-b64_pton(
+lutil_b64_pton(
char const *src,
u_char *target,
size_t targsize)
tarindex = 0;
while ((ch = *src++) != '\0') {
- if (isspace(ch)) /* Skip whitespace anywhere. */
+ if (isascii(ch) && isspace(ch)) /* Skip whitespace anywhere. */
continue;
if (ch == Pad64)
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)
* whitespace after it?
*/
for ((void)NULL; ch != '\0'; ch = *src++)
- if (!isspace(ch))
+ if (! (isascii(ch) && isspace(ch)))
return (-1);
/*