comparison src/main.c @ 43:9b309701420e

welcome to Ctec and will it compile? that is the question
author Paper <37962225+mrpapersonic@users.noreply.github.com>
date Fri, 20 May 2022 06:27:30 -0400
parents d873a04165f9
children 4f005d28d912
comparison
equal deleted inserted replaced
42:d873a04165f9 43:9b309701420e
147 fflush(stdout); 147 fflush(stdout);
148 scanf("%3s", args.type); 148 scanf("%3s", args.type);
149 } 149 }
150 fflush(stdout); 150 fflush(stdout);
151 if (strcmp(args.output, " ") == 0) { /* string manipulation hell */ 151 if (strcmp(args.output, " ") == 0) { /* string manipulation hell */
152 char temp[256] = (char*)malloc(sizeof(char)*256); 152 char temp* = (char*)malloc(sizeof(char)*256);
153 char str_version[16] = {}; 153 temp[0] = '\0';
154 char str_version[16];
154 sprintf(str_version, "V%d", args.version); 155 sprintf(str_version, "V%d", args.version);
155 strncat(temp, str_version, 2); 156 strncat(temp, str_version, 2);
156 strncat(temp, "_", 1); 157 strncat(temp, "_", 1);
157 strncat(temp, basename(args.input), 248); 158 strncat(temp, basename(args.input), 248);
158 strcpy(temp, strremove(temp, strrchr(basename(args.input), ('.')))); /* remove file extension */ 159 strcpy(temp, strremove(temp, strrchr(basename(args.input), ('.')))); /* remove file extension */