Skip to content

Commit

Permalink
Fix C89 compliance (mixed declarations and code)
Browse files Browse the repository at this point in the history
  • Loading branch information
rockdaboot committed Feb 11, 2024
1 parent e8ef87a commit 49c9e0c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/psl.c
Original file line number Diff line number Diff line change
Expand Up @@ -675,9 +675,9 @@ static int psl_idna_toASCII(psl_idna_t *idna, const char *utf8, char **ascii)
{
int ret = -1;

#if defined(WITH_LIBICU)
(void) idna;

#if defined(WITH_LIBICU)
/* IDNA2008 UTS#46 punycode conversion */
if (idna) {
char lookupname_buf[128] = "", *lookupname = lookupname_buf;
Expand Down Expand Up @@ -737,6 +737,8 @@ static int psl_idna_toASCII(psl_idna_t *idna, const char *utf8, char **ascii)
#if IDN2_VERSION_NUMBER >= 0x00140000
int rc;

(void) idna;

/* IDN2_TRANSITIONAL automatically converts to lowercase
* IDN2_NFC_INPUT converts to NFC before toASCII conversion
* Since IDN2_TRANSITIONAL implicitly does NFC conversion, we don't need
Expand Down Expand Up @@ -769,6 +771,8 @@ static int psl_idna_toASCII(psl_idna_t *idna, const char *utf8, char **ascii)
#elif defined(WITH_LIBIDN)
int rc;

(void) idna;

if (!utf8_is_valid(utf8)) {
/* fprintf(stderr, "Invalid UTF-8 sequence not converted: '%s'\n", utf8); */
return -1;
Expand All @@ -783,6 +787,8 @@ static int psl_idna_toASCII(psl_idna_t *idna, const char *utf8, char **ascii)
#else
char lookupname[128];

(void) idna;

if (domain_to_punycode(utf8, lookupname, sizeof(lookupname)) == 0) {
if (ascii)
if ((*ascii = strdup(lookupname)))
Expand Down

0 comments on commit 49c9e0c

Please sign in to comment.