# HG changeset patch # User Mikael Berthe # Date 1256511234 -3600 # Node ID c3c7d6d0348f77599a83363b87c3c54abff978a4 # Parent bf2258e29834af5e9aad2ba19b87cc7ee9647986 Remove (probably) unnecessary check The string is valid is the prep profile can be applied, AIUI. diff -r bf2258e29834 -r c3c7d6d0348f mcabber/src/utils.c --- a/mcabber/src/utils.c Sun Oct 25 23:32:23 2009 +0100 +++ b/mcabber/src/utils.c Sun Oct 25 23:53:54 2009 +0100 @@ -410,7 +410,7 @@ const char *domain, *resource; int domlen; #ifdef HAVE_LIBIDN - char *idnpp, *ascidnp; + char *idnpp; int r; #endif @@ -437,15 +437,6 @@ r = stringprep(idnprep, 1023, 0, stringprep_xmpp_nodeprep); if (r != STRINGPREP_OK || !idnprep[0]) return 1; - - // check the string hasn't been modified, in which case we consider - // it's a failure (as fjid is read-only) - idnpp = idnprep; - str = fjid; - while (*idnpp) { - if (*idnpp++ != *str++) - return 1; - } /* the username looks okay */ #else /* check for low and invalid ascii characters in the username */ @@ -496,20 +487,11 @@ if (r != STRINGPREP_OK || !idnprep[0]) return 1; - if (idna_to_ascii_8z(idnprep, &ascidnp, IDNA_USE_STD3_ASCII_RULES) != + if (idna_to_ascii_8z(idnprep, &idnpp, IDNA_USE_STD3_ASCII_RULES) != IDNA_SUCCESS) return 1; else - free(ascidnp); - - // check the string hasn't been modified, in which case we consider - // it's a failure (as fjid is read-only) - idnpp = idnprep; - str = domain; - while (*idnpp) { - if (*idnpp++ != *str++) - return 1; - } + free(idnpp); #else /* make sure the hostname is valid characters */ for (str = domain; *str != '\0' && *str != JID_RESOURCE_SEPARATOR; str++) {