mirror of
https://gitlab.freedesktop.org/libfprint/fprintd.git
synced 2026-01-03 18:40:17 +01:00
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"; | ^~~~~~~~~~~~~~~~~~~~
This commit is contained in:
parent
72d8a0f512
commit
2e00c7a4b1
1 changed files with 5 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue