diff options
Diffstat (limited to 'utils')
-rw-r--r-- | utils/idna.c | 8 | ||||
-rw-r--r-- | utils/utils.h | 16 |
2 files changed, 17 insertions, 7 deletions
diff --git a/utils/idna.c b/utils/idna.c index 2d1bb4ccb..545eff90d 100644 --- a/utils/idna.c +++ b/utils/idna.c @@ -453,14 +453,14 @@ static bool idna__is_valid(int32_t *label, size_t len) /* 4. Check characters not DISALLOWED by RFC5892 */ if (idna_prop == IDNA_P_DISALLOWED) { - LOG("Check failed: character %zd (%x) is DISALLOWED", i, label[i]); + LOG("Check failed: character %" PRIsizet " (%x) is DISALLOWED", i, label[i]); return false; } /* 5. Check CONTEXTJ characters conform to defined rules */ if (idna_prop == IDNA_P_CONTEXTJ) { if (idna__contextj_rule(label, i, len) == false) { - LOG("Check failed: character %zd (%x) does not conform to CONTEXTJ rule", i, label[i]); + LOG("Check failed: character %" PRIsizet " (%x) does not conform to CONTEXTJ rule", i, label[i]); return false; } } @@ -469,14 +469,14 @@ static bool idna__is_valid(int32_t *label, size_t len) /** \todo optionally we can check conformance to this rule */ if (idna_prop == IDNA_P_CONTEXTO) { if (idna__contexto_rule(label[i]) == false) { - LOG("Check failed: character %zd (%x) has no CONTEXTO rule defined", i, label[i]); + LOG("Check failed: character %" PRIsizet " (%x) has no CONTEXTO rule defined", i, label[i]); return false; } } /* 7. Check characters are not UNASSIGNED */ if (idna_prop == IDNA_P_UNASSIGNED) { - LOG("Check failed: character %zd (%x) is UNASSIGNED", i, label[i]); + LOG("Check failed: character %" PRIsizet " (%x) is UNASSIGNED", i, label[i]); return false; } diff --git a/utils/utils.h b/utils/utils.h index e4688ce2c..4b5360c5c 100644 --- a/utils/utils.h +++ b/utils/utils.h @@ -77,12 +77,22 @@ struct dirent; #define PRId64 "lld" #endif -/* Windows does not have POSIX formating codes or mkdir so work around that */ +/* Windows does not have sizet formating codes or POSIX mkdir so work + * around that + */ #if defined(_WIN32) -#define SSIZET_FMT "Iu" +/** windows printf formatting for size_t type */ +#define PRIsizet "Iu" +/** windows printf formatting for ssize_t type */ +#define PRIssizet "Id" +/** windows mkdir function */ #define nsmkdir(dir, mode) mkdir((dir)) #else -#define SSIZET_FMT "zd" +/** c99 standard printf formatting for size_t type */ +#define PRIsizet "zu" +/** c99 standard printf formatting for ssize_t type */ +#define PRIssizet "zd" +/** POSIX mkdir function */ #define nsmkdir(dir, mode) mkdir((dir), (mode)) #endif |