mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-25 08:37:13 +09:00
Remove ctype usage
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stddef.h>
|
||||
@@ -11,11 +10,6 @@
|
||||
#include "private/common.h"
|
||||
#include "utils.h"
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
/* gcc on FreeBSD can generate a bogus isspace implementation */
|
||||
# undef isspace
|
||||
#endif
|
||||
|
||||
/* Derived from original code by CodesInChaos */
|
||||
char *
|
||||
sodium_bin2hex(char *const hex, const size_t hex_maxlen,
|
||||
@@ -497,7 +491,8 @@ sodium_ip2bin(unsigned char bin[16], const char *ip,
|
||||
zone = memchr(ip, '%', (size_t) (end - ip));
|
||||
if (zone != NULL) {
|
||||
for (z = zone + 1; z < end; z++) {
|
||||
if (*z == '%' || isspace((unsigned char) *z)) {
|
||||
if (!((*z >= '0' && *z <= '9') || (*z >= 'a' && *z <= 'z') ||
|
||||
(*z >= 'A' && *z <= 'Z') || *z == '-' || *z == '_' || *z == '.')) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user