i18n: simplify numeric error reporting
[gitweb.git] / builtin / receive-pack.c
index 92e1213ecc05969f4601c7d3c48f6d96dcf72a0a..011db00d31709408a21b97abfb5742b97b54238d 100644 (file)
@@ -1478,11 +1478,9 @@ static struct command **queue_command(struct command **tail,
 
        refname = line + 82;
        reflen = linelen - 82;
-       cmd = xcalloc(1, st_add3(sizeof(struct command), reflen, 1));
+       FLEX_ALLOC_MEM(cmd, ref_name, refname, reflen);
        hashcpy(cmd->old_sha1, old_sha1);
        hashcpy(cmd->new_sha1, new_sha1);
-       memcpy(cmd->ref_name, refname, reflen);
-       cmd->ref_name[reflen] = '\0';
        *tail = cmd;
        return &cmd->next;
 }