mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-10-30 13:00:30 +00:00
sysfs: Expand filename buffer to quiet warning
The GCC heurisitc says that the buffer can overflow by 2 bytes, expand it.
This commit is contained in:
1 parent
f9ccac7d71
commit
43b6101bb0
1 file changed
+2
-2
+2
-2
@@ -437,11 +437,11 @@ static int sensors_compute_max_sf(void)
|
||||
|
||||
static int sensors_get_attr_mode(const char *device, const char *attr)
|
||||
{
|
||||
char path[NAME_MAX];
|
||||
char path[NAME_MAX + 2];
|
||||
struct stat st;
|
||||
int mode = 0;
|
||||
|
||||
snprintf(path, NAME_MAX, "%s/%s", device, attr);
|
||||
snprintf(path, NAME_MAX + 2, "%s/%s", device, attr);
|
||||
if (!stat(path, &st)) {
|
||||
if (st.st_mode & S_IRUSR)
|
||||
mode |= SENSORS_MODE_R;
|
||||
|
||||
Reference in new issue
Block a user