From 00dceb58da1649e3bb7d7a1fb29a57ae55dd483b Mon Sep 17 00:00:00 2001 From: red031000 Date: Sat, 18 Jul 2020 17:03:05 +0100 Subject: nitrogfx - use sprintf --- tools/nitrogfx/main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tools/nitrogfx') diff --git a/tools/nitrogfx/main.c b/tools/nitrogfx/main.c index 4ff025ab..56cf4abd 100644 --- a/tools/nitrogfx/main.c +++ b/tools/nitrogfx/main.c @@ -62,9 +62,9 @@ void ConvertNtrToPng(char *inputPath, char *outputPath, struct GbaToPngOptions * if (key) { - char string[strlen(outputPath) + 6]; - strcpy(string, outputPath); - FILE *fp = fopen(strcat(string, ".key"), "wb"); + char string[strlen(outputPath) + 5]; + sprintf(string, "%s.key", outputPath); + FILE *fp = fopen(string, "wb"); if (fp == NULL) FATAL_ERROR("Failed to open key file for writing.\n"); fwrite(&key, 4, 1, fp); @@ -102,9 +102,9 @@ void ConvertPngToNtr(char *inputPath, char *outputPath, struct PngToNtrOptions * uint32_t key = 0; if (options->scanned) { - char string[strlen(inputPath) + 6]; - strcpy(string, inputPath); - FILE *fp2 = fopen(strcat(string, ".key"), "rb"); + char string[strlen(inputPath) + 5]; + sprintf(string, "%s.key", inputPath); + FILE *fp2 = fopen(string, "rb"); if (fp2 == NULL) FATAL_ERROR("Failed to open key file for reading.\n"); size_t count = fread(&key, 4, 1, fp2); -- cgit v1.2.3