Re: r10990 rjek - /trunk/netsurf/content/urldb.c
by John Tytgat
In message <courier.4CFAC4C9.00005E91(a)atlanta.semichrome.net>
netsurf(a)semichrome.net wrote:
> Author: rjek
> Date: Sat Dec 4 16:46:33 2010
> New Revision: 10990
>
> URL: http://source.netsurf-browser.org?rev=10990&view=rev
> Log:
> Make urldb_add_url IPv6-aware
>
> Modified:
> trunk/netsurf/content/urldb.c
>
> Modified: trunk/netsurf/content/urldb.c
> URL: http://source.netsurf-browser.org/trunk/netsurf/content/urldb.c?rev=10990...
> ==============================================================================
> --- trunk/netsurf/content/urldb.c (original)
> +++ trunk/netsurf/content/urldb.c Sat Dec 4 16:46:33 2010
> @@ -791,12 +791,13 @@
> host++;
>
> /* get port and remove from host */
> - colon = strrchr(host, ':');
> - if (!colon) {
> - port = 0;
> - } else {
> - *colon = '\0';
> - port = atoi(colon + 1);
> + port = 0;
> + if (host[strlen(host)] != ']') {
Isn't host[strlen(host)] always NUL (assuming host points to a NUL
terminated string) ?
John.
--
John Tytgat
joty(a)netsurf-browser.org
12 years, 5 months