Author: cazfi
Date: Mon Dec  7 16:56:37 2015
New Revision: 30876

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

See bug #24096

Modified:
    trunk/utility/fcintl.c

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