url.c: fix possible use of non-null-terminated string with strlen

Follow up on b0e742544be22ede33206a597b22682e51e0c676
telnet.c: fix possible use of non-null-terminated strings