From: Enlightenment S. <no-...@en...> - 2010-08-31 04:34:52
|
Log: Use something safer then strncat. This is temporary anyway as eventually we will probably parse these messages properly. Author: mekius Date: 2010-08-30 21:34:42 -0700 (Mon, 30 Aug 2010) New Revision: 51770 Modified: trunk/PROTO/emote/src/lib/protocols/irc/irc_parse.c Modified: trunk/PROTO/emote/src/lib/protocols/irc/irc_parse.c =================================================================== --- trunk/PROTO/emote/src/lib/protocols/irc/irc_parse.c 2010-08-31 03:07:34 UTC (rev 51769) +++ trunk/PROTO/emote/src/lib/protocols/irc/irc_parse.c 2010-08-31 04:34:42 UTC (rev 51770) @@ -160,12 +160,13 @@ Eina_List *l; char *p; char buf[8192]; + int pos; buf[0] = 0; + pos = 0; EINA_LIST_FOREACH(ln.params->next, l, p) { - strncat(buf, p, sizeof(buf)); - strncat(buf, " ", sizeof(buf)); + pos += snprintf(&(buf[pos]), (sizeof(buf)-pos), "%s ", p); } d = emote_event_new( |