Clean up outstanding object_id transforms.
[gitweb.git] / builtin / receive-pack.c
index 7f484e7f6b41be0555babb54ba8853d0bf1e4269..f96834f42c9849746b64c20c84869232cbac7367 100644 (file)
@@ -1697,12 +1697,12 @@ static const char *unpack(int err_fd, struct shallow_info *si)
                if (status)
                        return "unpack-objects abnormal exit";
        } else {
-               char hostname[256];
+               char hostname[HOST_NAME_MAX + 1];
 
                argv_array_pushl(&child.args, "index-pack", "--stdin", NULL);
                push_header_arg(&child.args, &hdr);
 
-               if (gethostname(hostname, sizeof(hostname)))
+               if (xgethostname(hostname, sizeof(hostname)))
                        xsnprintf(hostname, sizeof(hostname), "localhost");
                argv_array_pushf(&child.args,
                                 "--keep=receive-pack %"PRIuMAX" on %s",