[shell-coding] Re: Compiling LS modules with DEV-C++

ilmcuts wrote:
> At 17:37 17.11.2003 -0500, Brian Wolven wrote:
>> I edited all the bang
>> function arguments so that they conform to the prototype, but some
>> string functions are unhappy when that is done, e.g., in this bang:
>>
>> void BangWinMove(HWND hCaller, LPCSTR pszArgs)
>>
>> this line generates errors:
>>
>> else if (strstr(strlwr(pszArgs),"centered"))
>>
>> unless it is changed to this:
>>
>> else if (strstr(strlwr((char *)pszArgs),"centered"))
>
> Please don't do that... strlwr modifies the source string and you thus
> modify an internal buffer in the core. In this case it most likely
> won't cause any harm, but you should should still avoid it if
> possible. As far as I can see you have two choices here, either make
> a copy of the source string or use a case insensitive strstr
> replacement, for example StrStrI.

Ahh - I'll take the safer approach then. Is that (StrStrI) one of the
functions in strsafe.h? I'm planning on going through the code and
bringing it, erm, up to code, so to speak. =P


__________________________________________________
Subscription options and archive:
http://www.freelists.org/list/shell-coding

Other related posts: