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
telnet.c: fix possible use of uninitialized variable
telnet.c: check sscanf results before passing them to snprintf
parsedate.c: check sscanf result before passing it to strlen