- Timestamp:
- 2015-01-16T19:50:25Z (10 years ago)
- Branches:
- master
- Children:
- ecbd22a
- Parents:
- 4cff28f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
nick.c
r4cff28f rfed4f76 227 227 { 228 228 nick_strip( irc, rets ); 229 rets[MAX_NICK_LENGTH] = '\0';229 truncate_utf8( rets, MAX_NICK_LENGTH ); 230 230 return rets; 231 231 } … … 252 252 else 253 253 { 254 nick[0] ++; 254 /* We've got no more space for underscores, 255 so truncate it and replace the last three 256 chars with a random "_XX" suffix */ 257 int len = truncate_utf8( nick, MAX_NICK_LENGTH - 3 ); 258 nick[len] = '_'; 259 g_snprintf(nick + len + 1, 3, "%2x", rand() ); 255 260 } 256 261 … … 400 405 if( strlen( down ) > strlen( nick ) ) 401 406 { 402 /* Well crap. Corrupt it if we have to. */ 403 down[strlen(nick)] = '\0'; 407 truncate_utf8( down, strlen(nick) ); 404 408 } 405 409 strcpy( nick, down );
Note: See TracChangeset
for help on using the changeset viewer.