Use str_copy instead of snprintf to copy strings

This commit is contained in:
Robert Müller 2022-10-19 23:31:07 +02:00
parent c4cf26ea81
commit 73fe4e6ed4
3 changed files with 7 additions and 7 deletions

View file

@ -46,9 +46,9 @@ int main(int argc, const char **argv)
}
char aFilenames[3][64];
snprintf(aFilenames[0], 64, "%s", argv[3]); //input_map
snprintf(aFilenames[1], 64, "%s", argv[9]); //output_map
snprintf(aFilenames[2], 64, "%s", argv[1]); //image_file
str_copy(aFilenames[0], argv[3]); //input_map
str_copy(aFilenames[1], argv[9]); //output_map
str_copy(aFilenames[2], argv[1]); //image_file
int aLayerID[2] = {str_toint(argv[4]), str_toint(argv[5])}; //layergroup_id, layer_id
int aStartingPos[2] = {str_toint(argv[6]) * 32, str_toint(argv[7]) * 32}; //pos_x, pos_y

View file

@ -130,7 +130,7 @@ int main(int argc, const char **argv)
}
char aFilename[64];
snprintf(aFilename, 64, "%s", argv[1]);
str_copy(aFilename, argv[1]);
int EnvID = str_toint(argv[2]) - 1;
dbg_msg("map_find_env", "input_map='%s'; env_number='#%d';", aFilename, EnvID + 1);

View file

@ -72,9 +72,9 @@ int main(int argc, const char *argv[])
}
char aaMapNames[3][64];
snprintf(aaMapNames[0], 64, "%s", argv[1]); //from_map
snprintf(aaMapNames[1], 64, "%s", argv[4]); //to_map
snprintf(aaMapNames[2], 64, "%s", argv[9]); //output_map
str_copy(aaMapNames[0], argv[1]); //from_map
str_copy(aaMapNames[1], argv[4]); //to_map
str_copy(aaMapNames[2], argv[9]); //output_map
float aaaGameAreas[2][2][2];