diff --git a/modules/map/src/mapapi.c b/modules/map/src/mapapi.c index 29ac4d3d9..ec86d8402 100644 --- a/modules/map/src/mapapi.c +++ b/modules/map/src/mapapi.c @@ -1164,7 +1164,7 @@ MAP_EXTERNCALL void map_set_gravity(MAP_ParameterType_t* p_type, const double gr MAP_EXTERNCALL void map_set_input_text(MAP_InitInputType_t* init_type, const char* input_txt_line) { - strncpy(init_type->library_input_str, input_txt_line, 254); + MAP_STRNCPY(init_type->library_input_str, input_txt_line, 254); init_type->library_input_str[254] = '\0'; } diff --git a/modules/map/src/mapsys.h b/modules/map/src/mapsys.h index e8966d6d0..e062fb162 100644 --- a/modules/map/src/mapsys.h +++ b/modules/map/src/mapsys.h @@ -69,11 +69,13 @@ # define map_snprintf _snprintf # define map_strcat(a,b,c) strcat_s(a,b,c) # define MAP_STRCPY(a,b,c) strcpy_s(a,b,c) +# define MAP_STRNCPY(a,b,c) strncpy_s(a,c,b,c) #else # include # define map_snprintf snprintf # define map_strcat(a,b,c) strncat(a,c,b) # define MAP_STRCPY(a,b,c) strcpy(a,c) +# define MAP_STRNCPY(a,b,c) strncpy(a,b,c) #endif