Rolf Kalbermatter wrote:

Jon Griffiths [mailto:[EMAIL PROTECTED] wrote:



+ goto FoldStringA_exit;
^^^^^^^^^^^^^^^^^^^^^^
No allocation has been done yet, just "return 0;" would be
enough!


Indeed, although the above is functionally identical. Feel free to
submit a patch if you feel strongly about it...



Interesting idea, but I wonder how you can distinguish between
equal 0 and FALSE without some real magic!
Same applies to lstrcmpi


No magic required. Use GetLastError(), just like it says.



Well so you want to say, if I want to test strings for equality I do first have to call GetLastError() to check if it was an error or if they are really equal?

This won't work as by definition a WinAPI function is usually not
supposed to reset the last error if no error has occurred, so
GetLastError() may return an error even though the strings were
just simply equal.

So I think that documentation is just simply wrong, also MSDN
doesn't say anything about this function returning any error
indication.

Rolf Kalbermatter




You can also do "SetLastError(ERROR_SUCCESS)" first yourself. That's also there in the docs.

Shachar

--
Shachar Shemesh
Open Source integration consultant
Home page & resume - http://www.shemesh.biz/





Reply via email to