From 35d10868f4a531eeb2dad8ae5bc3feb9f090b09e Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Wed, 15 Jun 2022 14:53:08 +0200 Subject: Reset buffer correctly --- src/ui/console.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/ui/console.c b/src/ui/console.c index 960aa5ea..6698a503 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -878,9 +878,8 @@ cons_show_qrcode(const char* const text) ProfWin* console = wins_get_console(); - char *buf = calloc((width * 4) + 1, 1); - - char *pad = calloc((width * 4) + 5, 1); + char* buf = calloc((width * 4) + 1, 1); + char* pad = calloc((width * 4) + 5, 1); if (!buf || !pad) { free(pad); @@ -903,7 +902,7 @@ cons_show_qrcode(const char* const text) // The extra squares are for padding, so that the QR code doesn't // "blend in" with the rest of the terminal window. win_println(console, THEME_DEFAULT, "", "\u2588\u2588%s\u2588\u2588", buf); - buf = { 0 }; + buf[0] = '\0'; } win_println(console, THEME_DEFAULT, "", "%s", pad); @@ -2948,4 +2947,3 @@ cons_remove_alert(ProfWin* window) g_list_free_full(item, g_free); free(win_name); } - -- cgit 1.4.1-2-gfad0