1
0
Fork 0
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:
Xorg 2022-09-24 18:57:35 +02:00
parent 49cb8703ca
commit 871840f8e5
No known key found for this signature in database
GPG key ID: 1E55EE2EFF18BC1A

View file

@ -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);