helpers: fix check for pid when creating device identifier

https://bugs.freedesktop.org/show_bug.cgi?id=94364
This commit is contained in:
Aleksander Morgado
2016-03-02 17:09:33 +01:00
parent c8a26e472e
commit 7c2d5b1aa3

View File

@@ -191,7 +191,7 @@ mm_create_device_identifier (guint vid,
g_checksum_update (sum, (const guchar *) &str_vid[0], strlen (str_vid)); g_checksum_update (sum, (const guchar *) &str_vid[0], strlen (str_vid));
g_string_append_printf (msg, "%08x", vid); g_string_append_printf (msg, "%08x", vid);
} }
if (vid) { if (pid) {
snprintf (str_pid, sizeof (str_pid) - 1, "%08x", pid); snprintf (str_pid, sizeof (str_pid) - 1, "%08x", pid);
g_checksum_update (sum, (const guchar *) &str_pid[0], strlen (str_pid)); g_checksum_update (sum, (const guchar *) &str_pid[0], strlen (str_pid));
g_string_append_printf (msg, "%08x", pid); g_string_append_printf (msg, "%08x", pid);