Tue 21 Aug 2007 03:00:56 PM EDT from [EMAIL PROTECTED]


More wet noodles for the German.

Lots and lots of wet noodles for him.

IsEmptyStr IS BROKEN and does not perform as expected in all circumstances. Thats what you get for using a macro.

IsEmptyStr as defined in tools.h is

#define IsEmptyStr(a) ((a)[0] == '\0')

Thats ok if you use it as IsEmptyStr(string)

But if you use it as IsEmptyStr(&string[x]) it is different than expected.

Lets expand it as the preprocessor would so that it becomes:

((&string[x])[0] == '\0')

Who can see what is wrong there then?

The fix is

#define IsEmptyStr(a) (*(a) == '\0')

 

Reply via email to