Commit 2e00c7a4 authored by Marco Trevisan's avatar Marco Trevisan Committed by Bastien Nocera
Browse files

enroll: Always use allocated memory for finger name

Given that finger_name is set by GOptionEntry, make sure it's always
using allocated memory.

../utils/enroll.c:38:28: error: initialization discards ‘const’ qualifier
  from pointer target type [-Werror=discarded-qualifiers]
38 | static char *finger_name = "right-index-finger";
   |                            ^~~~~~~~~~~~~~~~~~~~
parent 72d8a0f5
......@@ -32,7 +32,7 @@
static DBusGProxy *manager = NULL;
static DBusGConnection *connection = NULL;
static char *finger_name = "right-index-finger";
static char *finger_name = NULL;
static char **usernames = NULL;
static void create_manager(void)
......@@ -175,11 +175,15 @@ int main(int argc, char **argv)
return 1;
}
if (finger_name == NULL)
finger_name = g_strdup("right-index-finger");
create_manager();
dev = open_device(usernames ? usernames[0] : NULL);
do_enroll(dev);
release_device(dev);
g_free(finger_name);
return 0;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment