Author: cazfi
Date: Mon Dec  7 16:56:47 2015
New Revision: 30878

URL: http://svn.gna.org/viewcvs/freeciv?rev=30878&view=rev
Log:
Use fc_strlcpy() instead of strcpy()

See bug #24096

Modified:
    branches/S2_5/utility/fcintl.c

Modified: branches/S2_5/utility/fcintl.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/utility/fcintl.c?rev=30878&r1=30877&r2=30878&view=diff
==============================================================================
--- branches/S2_5/utility/fcintl.c      (original)
+++ branches/S2_5/utility/fcintl.c      Mon Dec  7 16:56:47 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

Reply via email to