On Fri, 2006-02-03 at 15:36 +0530, Vijay Kiran Kamuju wrote:
+SetLastError(0xdeadbeef);
retval=InternetQueryOptionA(hinet,INTERNET_OPTION_USER_AGENT,NULL,&len);
+err=GetLastError();
You need to initialize length parameter before InternetQueryOption call.
Hi.
I have initialized it the starting of the code. see newlen=len=strlen(useragent)+1; Are you talking about the first one, (i could see only one near the begining).
Thanks, Vijay
On 2/3/06, Dmitry Timoshkov dmitry@codeweavers.com wrote:
On Fri, 2006-02-03 at 15:36 +0530, Vijay Kiran Kamuju wrote:
+SetLastError(0xdeadbeef);
retval=InternetQueryOptionA(hinet,INTERNET_OPTION_USER_AGENT,NULL,&len);
+err=GetLastError();
You need to initialize length parameter before InternetQueryOption call.
-- Dmitry.
On Sat, 2006-02-04 at 09:16 +0530, Vijay Kiran Kamuju wrote:
I have initialized it the starting of the code. see newlen=len=strlen(useragent)+1; Are you talking about the first one, (i could see only one near the begining).
Yes, apparently I overlooked that one, sorry. I'd suggest to initialize len variable before each call where it's actually used and get rid of newlen variable, it's actually not used and in one place it's checked instead of the len.
Hi,
I did initialize at the start when we use it first time i dont have problems. And later where ever i am using that i have initialized it. oops regarding the newlen check i will change that. If dont use the newlen variable, on windows the test will definitely crash.
Thanks, VJ
On 2/4/06, Dmitry Timoshkov dmitry@codeweavers.com wrote:
On Sat, 2006-02-04 at 09:16 +0530, Vijay Kiran Kamuju wrote:
I have initialized it the starting of the code. see newlen=len=strlen(useragent)+1; Are you talking about the first one, (i could see only one near the begining).
Yes, apparently I overlooked that one, sorry. I'd suggest to initialize len variable before each call where it's actually used and get rid of newlen variable, it's actually not used and in one place it's checked instead of the len.
-- Dmitry.
On Sat, 2006-02-04 at 09:58 +0530, Vijay Kiran Kamuju wrote:
I did initialize at the start when we use it first time i dont have problems.
But people like me who review and will later add/fix your code may be confused by it.
And later where ever i am using that i have initialized it.
Please, do not do it later, do it at the appropriate time and place of the code.
oops regarding the newlen check i will change that. If dont use the newlen variable, on windows the test will definitely crash.
As I said, get rid of newlen altogether, it's confusing.