mirror of
https://github.com/anrieff/libcpuid
synced 2024-12-16 16:35:45 +00:00
Fix cpuid_serialize_raw_data_internal when no filename is provided
This commit is contained in:
parent
49cb8703ca
commit
871840f8e5
1 changed files with 2 additions and 2 deletions
|
@ -365,10 +365,10 @@ static int cpuid_serialize_raw_data_internal(struct cpu_raw_data_t* single_raw,
|
|||
FILE *f;
|
||||
|
||||
/* Open file descriptor */
|
||||
f = !strcmp(filename, "") ? stdin : fopen(filename, "wt");
|
||||
f = !strcmp(filename, "") ? stdout : fopen(filename, "wt");
|
||||
if (!f)
|
||||
return set_error(ERR_OPEN);
|
||||
debugf(1, "Writing raw CPUID dump to '%s'\n", f == stdin ? "stdin" : filename);
|
||||
debugf(1, "Writing raw CPUID dump to '%s'\n", f == stdout ? "stdout" : filename);
|
||||
|
||||
/* Write raw data to output file */
|
||||
fprintf(f, "version=%s\n", VERSION);
|
||||
|
|
Loading…
Reference in a new issue