We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 272ef08 commit 559a2f3Copy full SHA for 559a2f3
src/mbpfan.c
@@ -167,9 +167,7 @@ t_sensors *retrieve_sensors()
167
int counter;
168
for (counter = 0; counter < NUM_HWMONS; counter++) {
169
170
- char hwmon_path[strlen(path_begin)+2];
171
-
172
- sprintf(hwmon_path, "%s%d", path_begin, counter);
+ char *hwmon_path = smprintf("%s%d", path_begin, counter);
173
174
int res = access(hwmon_path, R_OK);
175
if (res == 0) {
@@ -186,8 +184,11 @@ t_sensors *retrieve_sensors()
186
184
187
185
}
188
+ free(hwmon_path);
189
break;
190
+
191
192
193
194
int core = 0;
0 commit comments