From: Zilo <ko...@gm...> - 2005-01-13 13:10:36
|
On 01/13/05 13:50:51, Gary Kramlich wrote: > On Thu, 2005-01-13 at 12:21 +0000, evew wrote: > > I found a bug inside bnet_buddy_add() in a wrong use of > gaim_normalize > > (): > > > > name =3D gaim_normalize(conn->account, buddy->name); > > > > Using name for saving our buddy inside the hash table is wrong > 'cause > > gaim_normalize() returns a pointer to a own static array... then =20 > its >=20 > > value isn't the same during time :P > > > > As a result of this when receiving friends list all buddy are > > considered new (because not found in conn->buddies) then (re)added > in > > the gaim list... resulting in a big increasing of our popolarity in > a > > few seconds :) > > > > Anyway, I was thinking about the needing of this line... 'cause if > it's > > useful, then we can simply g_strdup() name, but we are already =20 > using >=20 > > gaim_utf8_strcasecmp() to compare nicks in the hash table... isn't > > enough? > > > > cya >=20 > I thought we were strcmp'n it which would make that legit.. But if > we're just comparing pointers, than yeah thats going to be a =20 > problem... Uhm... I'm not sure I understand your answer... excuse my english, just =20 in case :P Anyway, we were strcmp'n it... the problem is that the pointer returned =20 by gaim_normalize() is always the same, and its contents change every =20 time we call the function. I'm not very familiar with gaim code, so I was asking what is the =20 meaning of using gaim_normalize()... because if we need it only to strdown our names, well, there's already gaim_utf8_strcasecmp()... Well, in others words, I don't know what g_utf8_normalize() is supposed =20 to do :) cya |