Skip to content

Commit f59b46e

Browse files
authored
Merge pull request #2420 from andrew-platt/b/map_strncpy_2
MAP: change strncpy to use macro MAP_STRNCPY
2 parents e8d0ea9 + 4e69da8 commit f59b46e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

modules/map/src/mapapi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,7 @@ MAP_EXTERNCALL void map_set_gravity(MAP_ParameterType_t* p_type, const double gr
11641164

11651165
MAP_EXTERNCALL void map_set_input_text(MAP_InitInputType_t* init_type, const char* input_txt_line)
11661166
{
1167-
strncpy(init_type->library_input_str, input_txt_line, 254);
1167+
MAP_STRNCPY(init_type->library_input_str, input_txt_line, 254);
11681168
init_type->library_input_str[254] = '\0';
11691169
}
11701170

modules/map/src/mapsys.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,13 @@
6969
# define map_snprintf _snprintf
7070
# define map_strcat(a,b,c) strcat_s(a,b,c)
7171
# define MAP_STRCPY(a,b,c) strcpy_s(a,b,c)
72+
# define MAP_STRNCPY(a,b,c) strncpy_s(a,c,b,c)
7273
#else
7374
# include <stdbool.h>
7475
# define map_snprintf snprintf
7576
# define map_strcat(a,b,c) strncat(a,c,b)
7677
# define MAP_STRCPY(a,b,c) strcpy(a,c)
78+
# define MAP_STRNCPY(a,b,c) strncpy(a,b,c)
7779
#endif
7880

7981

0 commit comments

Comments
 (0)