about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2022-06-15 14:53:08 +0200
committerMichael Vetter <jubalh@iodoru.org>2022-06-15 15:09:38 +0200
commit35d10868f4a531eeb2dad8ae5bc3feb9f090b09e (patch)
tree570a81b08c3f1f9f74348cefecfc3197854a84a2 /src
parent7276db07f4dcee46b81506e4855bc01338455aea (diff)
downloadprofani-tty-35d10868f4a531eeb2dad8ae5bc3feb9f090b09e.tar.gz
Reset buffer correctly
Diffstat (limited to 'src')
-rw-r--r--src/ui/console.c8
1 files 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);
 }
-