[JDEV] ambiguous libxode/j_strcat()

Gurer Ozen madcat at e-kolay.net
Mon Oct 23 19:17:10 CDT 2000

DC> Anyway j_strcat() doesn't seem to be used anywhere.

Older versions of spool_print() were using real strcat(), so
I added this one as a quick hack to make it faster. Hopefully
my new client library is keeping sizes and using memcpy() for
such stuff, so it is even faster.

DC> As a related note, I think j_str*() functions shouldn't
DC> return silently when passed NULL arguments, but instead
DC> should print a warning. Warnings using __FILE__ and __LINE__
DC> are a must :-)

How about following?

if(j_strcmp(xmlnode_get_attrib(x, "type"), "groupchat") == 0) ...

NULL safe functions make it possible to chain those small functions.
So even if there is no "type" attribute, if() check works correctly.

Unfortunately standart strcmp() function gives segfault with NULL

Gurer Ozen <jabber:madcat at jabber.org>

More information about the JDev mailing list