logo

badwolf

Minimalist and privacy-oriented WebKitGTK+ browser
commit: 186cee6c2b5d80046c71022d422f9df17bbd21d5
parent: d4a4b0ab1b5809a7a85b786135627bf9e0448908
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Thu, 30 Jan 2020 03:59:22 +0100

badwolf.c: Make *window declaration static

This allows to avoid a useless malloc() call done ourselves.

Diffstat:

Mbadwolf.c9+--------
1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/badwolf.c b/badwolf.c @@ -744,14 +744,7 @@ badwolf_get_tab_position(GtkContainer *notebook, GtkWidget *child) int main(int argc, char *argv[]) { - // getting an abort if this one fails to alloc - struct Window *window = malloc(sizeof(struct Window)); - if(window == NULL) - { - perror("malloc"); - return 1; - } - + struct Window *window = &(struct Window){NULL}; setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, DATADIR "/locale"); bind_textdomain_codeset(PACKAGE, "UTF-8");