diff options
author | red031000 <rubenru09@aol.com> | 2020-07-18 17:03:05 +0100 |
---|---|---|
committer | red031000 <rubenru09@aol.com> | 2020-07-18 17:03:18 +0100 |
commit | 00dceb58da1649e3bb7d7a1fb29a57ae55dd483b (patch) | |
tree | d6e294c3a82c2bd09c9d6511b1ca9958b2c9860b | |
parent | 3dc300bf1b804cf0583dfb561c14deda47b0b85b (diff) |
nitrogfx - use sprintf
-rw-r--r-- | tools/nitrogfx/main.c | 12 |
1 files changed, 6 insertions, 6 deletions
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); |