() Toke Høiland-Jørgensen () Mon, 24 Nov 2014 13:17:22 +0100 + char *c; bool send_hostname = 0; /* Placeholders for the property list elements. */ Lisp_Object priority_string; @@ -1375,6 +1381,22 @@ one trustfile (usually a CA bundle). */) if (ret < GNUTLS_E_SUCCESS) return gnutls_make_error (ret); + /* Quick and dirty test of the hostname; shouldn't be an IP. If it + contains letters, we assume it's a hostname, unless it contains a + : in which case we assume it's a literal IPv6 address. */ + for(c = c_hostname; c; c++) { + if(c >= 'a') send_hostname = 1; + if(c == ':') {send_hostname = 0; break;} + } Aside from the whitespace and brace placement, this code is buggy: ‘c’ is of type ‘char *’ and cannot be meaningfully compared directly to 'a'. -- Thien-Thi Nguyen GPG key: 4C807502 (if you're human and you know it) read my lisp: (responsep (questions 'technical) (not (via 'mailing-list))) => nil