use snprintf for string handling in batget

CID 1039801
This commit is contained in:
Mike Blumenkrantz 2016-03-22 15:10:50 -04:00
parent 9731acfe4a
commit fbda06d657
1 changed files with 1 additions and 2 deletions

View File

@ -996,8 +996,7 @@ linux_acpi_init(void)
FILE *f;
if (info->name_length + sizeof("/state") >= sizeof(buf)) continue;
strcpy(buf, info->path);
strcat(buf, "/state");
snprintf(buf, sizeof(buf), "%s/state", info->path);
f = fopen(buf, "r");
if (f)
{