AQB Flicker: Replace malloc with g_malloc0.

Windows doesn't know about malloc.
This commit is contained in:
John Ralls 2020-12-13 13:49:24 -08:00
parent 14a53032f1
commit 2c8ae267f9

View File

@ -131,7 +131,7 @@ static char
/* prepend synchronization identifier */
const char pre[] = {'0', 'F', 'F', 'F'};
size_t len = sizeof (pre) + strlen (challenge) + 1;
char* code = (char*)malloc (len);
char* code = (char*)g_malloc0 (len);
memcpy (code, pre, sizeof (pre));
memcpy (code + sizeof (pre), challenge, strlen (challenge));
@ -306,7 +306,7 @@ do_flicker_store_state (GtkWidget *dialog)
static void
on_flicker_challenge_map (GtkWidget *widget)
{
gchar *code = g_malloc (strlen (flickerdraw.challenge) + 4);
gchar *code = g_malloc0 (strlen (flickerdraw.challenge) + 4);
code = flicker_data (flickerdraw.challenge);
flickerdraw.challenge_length = strlen (code);