ansilove

ANSI and ASCII art to PNG converter in C
Log | Files | Refs | README | LICENSE

commit d42cf0c4464de829f45b2d8e24ac0af64bda0c33
parent a1f59f0fd86bab4de0d9a09ae4bfe5fff2084e49
Author: Frederic Cambus <fred@statdns.com>
Date:   Mon, 11 Jul 2016 13:14:11 +0200

Use strdup when lowercasing file extension, to avoid modifying input filename

Diffstat:
Msrc/main.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main.c b/src/main.c @@ -280,7 +280,7 @@ int main(int argc, char *argv[]) { // get file extension char *fext = strrchr(input, '.'); - fext = fext ? strtolower(fext) : ""; + fext = fext ? strtolower(strdup(fext)) : ""; // create the output file by invoking the appropiate function if (!strcmp(fext, ".pcb")) {