Author: cazfi
Date: Mon Jun 20 17:50:06 2016
New Revision: 32930

URL: http://svn.gna.org/viewcvs/freeciv?rev=32930&view=rev
Log:
Made capitalized_string() not to leave last character out from the returned 
string,
or making it broken one in case of multi-byte character.

Reported by Markus Linnakangas <mlinnaka>

See bug #24754

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=32930&r1=32929&r2=32930&view=diff
==============================================================================
--- branches/S2_6/utility/fcintl.c      (original)
+++ branches/S2_6/utility/fcintl.c      Mon Jun 20 17:50:06 2016
@@ -1,4 +1,4 @@
-/********************************************************************** 
+/***********************************************************************
  Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -64,7 +64,7 @@
   int len = strlen(str);
   char *result = fc_malloc(len + 1);
 
-  fc_strlcpy(result, str, len);
+  fc_strlcpy(result, str, len + 1);
 
   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