]> granicus.if.org Git - cgit/commitdiff
ui-shared: avoid initializing static variable to zero
authorJohn Keeping <john@keeping.me.uk>
Sun, 8 Mar 2015 16:32:24 +0000 (16:32 +0000)
committerJason A. Donenfeld <Jason@zx2c4.com>
Mon, 9 Mar 2015 16:40:24 +0000 (17:40 +0100)
Sparse complains that we are using a plain integer as a NULL pointer
here, but in fact we do not have to specify a value for this variable at
all since it has static storage duration and thus will be initialized to
NULL by the compiler.

Signed-off-by: John Keeping <john@keeping.me.uk>
ui-shared.c

index d4c4bb91c6aeca8993f5f492f6392e86496c401d..1e3c13176a174b4a31558feca4aa8dd20e8cda80 100644 (file)
@@ -82,7 +82,7 @@ const char *cgit_rooturl(void)
 
 const char *cgit_loginurl(void)
 {
-       static const char *login_url = 0;
+       static const char *login_url;
        if (!login_url)
                login_url = fmtalloc("%s?p=login", cgit_rooturl());
        return login_url;