struct initval_raw raw;
struct fw_header hdr;
unsigned int size;
+ unsigned int filesize = 0;
memset(&hdr, 0, sizeof(hdr));
hdr.type = FW_TYPE_IV;
hdr.ver = FW_HDR_VER;
hdr.size = cpu_to_be32(ctx->ivals_count);
- fn_len = strlen(outfile_name) + 512;
+ fn_len = strlen(ctx->sect->name) + strlen(initvals_fn_extension ? : "") + 1;
fn = xmalloc(fn_len);
- snprintf(fn, fn_len, "%s.%s.initval", outfile_name, ctx->sect->name);
+ snprintf(fn, fn_len, "%s%s", ctx->sect->name, initvals_fn_extension ? : "");
fd = fopen(fn, "w+");
if (!fd) {
fprintf(stderr, "Could not open initval output file \"%s\"\n", fn);
fprintf(stderr, "Could not write initvals outfile\n");
exit(1);
}
+ filesize += size;
}
+
+ if (arg_print_sizes) {
+ printf("%s: %d values (%u bytes)\n",
+ fn, ctx->ivals_count, filesize);
+ }
+
fclose(fd);
free(fn);
}