[mapserver-commits] r11866 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Sat Jul 2 11:48:28 EDT 2011
Author: rouault
Date: 2011-07-02 08:48:28 -0700 (Sat, 02 Jul 2011)
New Revision: 11866
Modified:
trunk/mapserver/mapprojhack.c
Log:
make sure that string is always nul-terminated
Modified: trunk/mapserver/mapprojhack.c
===================================================================
--- trunk/mapserver/mapprojhack.c 2011-07-02 15:26:36 UTC (rev 11865)
+++ trunk/mapserver/mapprojhack.c 2011-07-02 15:48:28 UTC (rev 11866)
@@ -27,12 +27,8 @@
****************************************************************************/
#include <string.h>
-#include "mapproject.h"
+#include "mapserver.h"
-enum MS_UNITS {MS_INCHES, MS_FEET, MS_MILES, MS_METERS, MS_KILOMETERS,
- MS_DD, MS_PIXELS, MS_NAUTICALMILES};
-
-
/************************************************************************/
/* ConvertProjUnitStringToMS */
/* */
@@ -96,7 +92,7 @@
char units[32];
char *blank;
- strncpy( units, (strstr(proj_str,"units=")+6), sizeof(units)-2 );
+ strlcpy( units, (strstr(proj_str,"units=")+6), sizeof(units) );
pj_dalloc( proj_str );
blank = strchr(units, ' ');
More information about the mapserver-commits
mailing list