Re: strtok

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Not there....
There seems to be a problem on this line (from the debugger)

strcpy (ins, (char *) g_pMappedFileBase);

Where I defined g_pMappedFileBase as PBYTE
Thanks
Jack



"Jochen Kalmbach [MVP]" <nospam-Jochen.Kalmbach@xxxxxxxxx>
???????:%23mS6XsifFHA.1148@xxxxxxxxxxxxxxxxxxxxxxx
> Hi Jacky!
>
> > char *ins;
> > char *linedetails;
>
> Ok, "ins" and "linedetails" are "char*" (_not_ PBYTE!)
>
>> ins = new char[500000];
>
> Ok (you should check for == NULL)
>
>> strcpy (ins, (char *) g_pMappedFileBase);
>
> Ok (hopefully the length is enough...)
>
>> linedetails = strtok ((char *)ins, (const char *)"\n");
>
> Why do you cast? Why not just:
> linedetails = strtok(ins, "\n");
> ???
>
> Was this the problematic line?
> I cant see any problem here (expect for the abouve ones ;-) ).
>
> --
> Greetings
> Jochen
>
> My blog about Win32 and .NET
> http://blog.kalmbachnet.de/


.



Relevant Pages

  • Re: strtok
    ... it is a PBYTE ... Jack ... > Hi Jacky! ... Prev by Date: ...
    (microsoft.public.vc.language)
  • Re: About Wintrust.h
    ... Jack ... > Hi Jeff + Igor, ... > PBYTE GetToken ... its presence shows some annoying errors and ...
    (microsoft.public.vc.language)
  • Re: Loading exe at fixed preferred address
    ... Après mure réflexion, Jack a écrit: ... I am building a kernel debugger. ... >> preferred load address of the module is 0x401000, ...
    (microsoft.public.win32.programmer.kernel)
  • Re: bootloader
    ... Jack ... > Hi Jacky! ... > My blog about Win32 and .NET ... Prev by Date: ...
    (microsoft.public.win32.programmer.kernel)
  • Re: strtok
    ... PBYTE ins; // local var ... Jack ... > Unhandled exception at 0x00401f5b in try.exe: 0xC0000005: Access violation ...
    (microsoft.public.vc.language)