Author: cazfi Date: Mon Dec 7 16:56:41 2015 New Revision: 30877 URL: http://svn.gna.org/viewcvs/freeciv?rev=30877&view=rev Log: Use fc_strlcpy() instead of strcpy()
See bug #24096 Modified: branches/S2_6/utility/fcintl.c Modified: branches/S2_6/utility/fcintl.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/utility/fcintl.c?rev=30877&r1=30876&r2=30877&view=diff ============================================================================== --- branches/S2_6/utility/fcintl.c (original) +++ branches/S2_6/utility/fcintl.c Mon Dec 7 16:56:41 2015 @@ -61,9 +61,10 @@ ***********************************************************************/ char *capitalized_string(const char *str) { - char *result = fc_malloc(strlen(str) + 1); + int len = strlen(str); + char *result = fc_malloc(len + 1); - strcpy(result, str); + fc_strlcpy(result, str, len); if (autocap) { if ((unsigned char) result[0] < 128) { _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits