We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c120eca commit 9dedec5Copy full SHA for 9dedec5
api.cpp
@@ -321,8 +321,12 @@ static const char* os_name()
321
return "windows";
322
#else
323
FILE *fd = fopen("/proc/version", "r");
324
- if (!fd || !fscanf(fd, "Linux version %48s", &os_version[6]))
+ if (!fd)
325
return "linux";
326
+ if (!fscanf(fd, "Linux version %48s", &os_version[6])) {
327
+ fclose(fd);
328
+ return "linux";
329
+ }
330
fclose(fd);
331
os_version[48] = '\0';
332
return (const char*) os_version;
sysinfos.cpp
@@ -50,8 +50,9 @@ static uint32_t linux_cpufreq(int core)
50
return freq;
51
52
if (!fscanf(fd, "%d", &freq))
53
- return freq;
+ ;
54
55
56
57
}
58
0 commit comments