summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/map.c')
-rw-r--r--src/map/map.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/map/map.c b/src/map/map.c
index 7eafde9dc..640dd0ce1 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -3353,10 +3353,10 @@ int map_waterheight(char* mapname)
char *rsw, *found;
//Look up for the rsw
- sprintf(fn, "data\\%s.rsw", mapname);
+ snprintf(fn, sizeof(fn), "data\\%s.rsw", mapname);
- found = grfio_find_file(fn);
- if (found) strcpy(fn, found); // replace with real name
+ if ( (found = grfio_find_file(fn)) )
+ safestrncpy(fn, found, sizeof(fn)); // replace with real name
// read & convert fn
rsw = (char *) grfio_read (fn);