tools/record: localize a variable

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2021-03-26 08:39:48 +10:00
parent 8b822a84c4
commit e511f96201

View file

@ -2042,7 +2042,6 @@ all_devices(void)
{
struct dirent **namelist;
int ndev;
int rc;
char **devices = NULL;
ndev = scandir("/dev/input", &namelist, is_event_node, versionsort);
@ -2053,9 +2052,9 @@ all_devices(void)
for (int i = 0; i < ndev; i++) {
char *device_path;
rc = xasprintf(&device_path,
"/dev/input/%s",
namelist[i]->d_name);
int rc = xasprintf(&device_path,
"/dev/input/%s",
namelist[i]->d_name);
if (rc == -1)
goto error;