]> git.cameronkatri.com Git - cgit.git/blobdiff - shared.c
Bump version.
[cgit.git] / shared.c
index d7c7636913a063cfc45eadab85f282a2bf5b6cc3..609bd2a30670e5eab7974593fd98c6d9e95c24bc 100644 (file)
--- a/shared.c
+++ b/shared.c
@@ -53,6 +53,7 @@ struct cgit_repo *cgit_add_repo(const char *url)
        ret->name = ret->url;
        ret->path = NULL;
        ret->desc = cgit_default_repo_desc;
+       ret->extra_head_content = NULL;
        ret->owner = NULL;
        ret->homepage = NULL;
        ret->section = ctx.cfg.section;
@@ -475,15 +476,16 @@ static int is_token_char(char c)
 static char *expand_macro(char *name, int maxlength)
 {
        char *value;
-       int len;
+       size_t len;
 
        len = 0;
        value = getenv(name);
        if (value) {
-               len = strlen(value);
+               len = strlen(value) + 1;
                if (len > maxlength)
                        len = maxlength;
-               strncpy(name, value, len);
+               strlcpy(name, value, len);
+               --len;
        }
        return name + len;
 }