aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/nogaim.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2007-06-04 14:36:51 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2007-06-04 14:36:51 +0100
commite0e2a71ed3e7937ed5da85af95be016a8441547b (patch)
tree67cdfc8d9b8cb87f247f463499f2831414dc5032 /protocols/nogaim.c
parentd06eabf19ec3f849d8bab22c13d43e4eba9a48ee (diff)
Fixed retarded use of strcpy() and no longer using Jabber fullnames for
nickname generation. IM fullnames and IRC nicknames are just *different*.
Diffstat (limited to 'protocols/nogaim.c')
-rw-r--r--protocols/nogaim.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/protocols/nogaim.c b/protocols/nogaim.c
index 71cebacd..06bd8e4b 100644
--- a/protocols/nogaim.c
+++ b/protocols/nogaim.c
@@ -448,13 +448,14 @@ void imcb_buddy_nick_hint( struct im_connection *ic, char *handle, char *nick )
user_t *u = user_findhandle( ic, handle );
char newnick[MAX_NICK_LENGTH+1];
- if( !u->online && !nick_saved( ic->acc, handle ) )
+ if( u && !u->online && !nick_saved( ic->acc, handle ) )
{
/* Only do this if the person isn't online yet (which should
be the case if we just added it) and if the user hasn't
assigned a nickname to this buddy already. */
- strcpy( newnick, nick );
+ strncpy( newnick, nick, MAX_NICK_LENGTH );
+ newnick[MAX_NICK_LENGTH] = 0;
/* Some processing to make sure this string is a valid IRC nickname. */
nick_strip( newnick );