[mw-devel] MW3 r1083 - trunk/src

welshbyte at sucs.org welshbyte at sucs.org
Wed Apr 15 01:43:18 BST 2009


Author: welshbyte
Date: 2009-04-15 01:43:17 +0100 (Wed, 15 Apr 2009)
New Revision: 1083

Modified:
   trunk/src/incoming.c
Log:
This snprintf was truncating the usernames to 14 chars by using NAMESIZE-1 as the length (including '\0') when it should be NAMESIZE+1. Closes #49


Modified: trunk/src/incoming.c
===================================================================
--- trunk/src/incoming.c	2009-04-03 12:20:21 UTC (rev 1082)
+++ trunk/src/incoming.c	2009-04-15 00:43:17 UTC (rev 1083)
@@ -562,7 +562,7 @@
 			force_protpower(newbuff);
 			break;
 		case IPC_USERNAME:
-			snprintf(user->name, NAMESIZE-1,"%s",newbuff);
+			snprintf(user->name, NAMESIZE+1,"%s",newbuff);
 			printf(_("\nYour name has been changed to '%s'\n"),user->name);
 			break;
 		case IPC_LASTREAD:




More information about the mw-devel mailing list