On Tue, Nov 01, 2005 at 12:35:00PM +0100, Andreas Mohr wrote:
Hi,
On Fri, Oct 28, 2005 at 09:48:08AM -0700, Juan Lang 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 ":".
OK, done! ;)
ChangeLog: Replace all Wine instances of doing a strlen() on a string literal by its equivalent but much less onerous sizeof() - 1.
Please just keep it as is.
The compiler knows strings constants and strlen() and will replace it by a constant on compile time.
Ciao, Marcus
Hi,
On Tue, Nov 01, 2005 at 12:47:15PM +0100, Marcus Meissner wrote:
On Tue, Nov 01, 2005 at 12:35:00PM +0100, Andreas Mohr wrote:
ChangeLog: Replace all Wine instances of doing a strlen() on a string literal by its equivalent but much less onerous sizeof() - 1.
Please just keep it as is.
The compiler knows strings constants and strlen() and will replace it by a constant on compile time.
Indeed, doing a small test with standard optimization confirms it, but I really didn't expect this to be the case.
Since using strlen() usually is much more readable and it isn't required anyway, the patch should be discarded.
Andreas