Hi James,
+/* max port num is 655936 => 6 digits */
Actually, it's 65535. A correct comment would be appreciated ;)
+ *lpdwUrlLength += strlen("://");
You should use sizeof instead to avoid the call to strlen. Same for other lengths you use, like "@" and ":".
+ if (lpUrlComponents->nPort != 80 ||
This seems a bit funny. Port 80 has no meaning for INTERNET_SCHEME_FTP or any other non-HTTP protocol, does it?
--Juan
__________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com
On Fri, 28 Oct 2005 18:48:08 +0200, Juan Lang juan_lang@yahoo.com wrote:
Hi James,
+/* max port num is 655936 => 6 digits */
Actually, it's 65535. A correct comment would be appreciated ;)
- *lpdwUrlLength += strlen("://");
You should use sizeof instead to avoid the call to strlen. Same for other lengths you use, like "@" and ":".
- if (lpUrlComponents->nPort != 80 ||
This seems a bit funny. Port 80 has no meaning for INTERNET_SCHEME_FTP or any other non-HTTP protocol, does it?
--Juan
AFAIK port 80 is merely a conventional default port for HTTP, as with most protocols. My IP blocks pop on port 25 so I move it. Idem. amule ports and all other services.
21 is the default for ftp but there should be nothing to block it being configged otherwise.
;)
__________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com
On 10/28/05, Juan Lang juan_lang@yahoo.com wrote:
Hi James,
+/* max port num is 655936 => 6 digits */
Actually, it's 65535. A correct comment would be appreciated ;)
InternetCreateUrl doesn't check whether it's a valid port number or not. The comment is about the maximum value for the port number in the context of InternetCreateUrl which is the greatest value of a WORD value before it overflows.
- *lpdwUrlLength += strlen("://");
You should use sizeof instead to avoid the call to strlen. Same for other lengths you use, like "@" and ":".
I disagree. sizeof belies the intent of the code, whereas strlen is a better rerpesentative of the fact that im taking the length of a string. The time saved using sizeof isn't worth it to me. If it doesn't get accepted because of that, I'll change it, but I think it's fine right now.
- if (lpUrlComponents->nPort != 80 ||
This seems a bit funny. Port 80 has no meaning for INTERNET_SCHEME_FTP or any other non-HTTP protocol, does it?
It won't matter because the port number is always displayed for non-HTTP protocols, so this is just a quick short-circuit. You can think of it list this: if the port number is not 80 it will always be displayed, but if it is 80, it will only be displayed if the scheme is not HTTP.
-- James Hawkins
+/* max port num is 655936 => 6 digits */
Actually, it's 65535. A correct comment would be appreciated ;)
InternetCreateUrl doesn't check whether it's a valid port number or not. The comment is about the maximum value for the port number in the context of InternetCreateUrl which is the greatest value of a WORD value before it overflows.
Right, and that's why I say, the comment is wrong. 655936 is too large for a WORD, and so is 65536, which I believe you meant to type. The correct value is 65535.
--Juan
__________________________________ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com
On 10/28/05, Juan Lang juan_lang@yahoo.com wrote:
Right, and that's why I say, the comment is wrong. 655936 is too large for a WORD, and so is 65536, which I believe you meant to type. The correct value is 65535.
Oops. You are correct. Sorry for being stubborn about that point. I guess I added an extra 9 in there and should've taken that down one. Thanks for the suggestion.
-- James Hawkins