[Crossfire-wiki] [Crossfire DokuWiki] page changed: user:mhoram:code:bwp
no-reply_wiki at metalforge.org
no-reply_wiki at metalforge.org
Wed Jan 17 07:02:56 CST 2007
A page in your DokuWiki was added or changed. Here are the details:
Date : 2007/01/17 07:02
User : ryo
Edit Summary: evil **
@@ -5,9 +5,11 @@
The main problem I'm having right now is that a couple variables are getting clobbered; I assume by bad memory allocation. It happens at line 502: the variables *key[] and *val[] are fine before that call to join_with_comma(), but after it they are messed up. (Search for BEFORE and AFTER.) Since they aren't involved in that function at all, I assume that something in that function is causing an overflow. There's probably a way with gdb or some other tool to see what variable is using a particular memory address, but I don't know what it is.
Also, if anyone knows of a good C primer/tutorial online, please let me know.
- In the sortbyname, a and b will be const char* *, not char*, thus you need to dereference them => ''strcpy(aa,(*(const char**)a));'' or something like that :)
+ In the sortbyname, a and b will be const char* *, not char*, thus you need to dereference them => ''strcpy(aa,(*(const char* *)a));'' or something like that :)
+
+ Also, to compare, try ''strcasecmp'' which does case-insensitive comparison.
===== Notes & Comments =====
IP-Address : 196.3.55.241
Old Revision: http://wiki.metalforge.net/doku.php/user:mhoram:code:bwp?rev=1169038906
New Revision: http://wiki.metalforge.net/doku.php/user:mhoram:code:bwp
--
This mail was generated by DokuWiki at
http://wiki.metalforge.net/
More information about the crossfire-wiki
mailing list