daemon: default to 256 for HOST_NAME_MAX if it is not defined
[gitweb.git] / builtin-log.c
index 691cf3aef785950132c6be65f8aab39d4b12207e..130b53a1960988aaf77014d39ee712a4848777b3 100644 (file)
@@ -101,7 +101,7 @@ static int git_format_config(const char *var, const char *value)
        if (!strcmp(var, "format.headers")) {
                int len = strlen(value);
                extra_headers_size += len + 1;
-               extra_headers = realloc(extra_headers, extra_headers_size);
+               extra_headers = xrealloc(extra_headers, extra_headers_size);
                extra_headers[extra_headers_size - len - 1] = 0;
                strcat(extra_headers, value);
                return 0;
@@ -270,6 +270,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 
        rev.extra_headers = extra_headers;
 
+       output_directory = prefix;
+
        /*
         * Parse the arguments before setup_revisions(), or something
         * like "git fmt-patch -o a123 HEAD^.." may fail; a123 is
@@ -381,7 +383,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
                        continue;
 
                nr++;
-               list = realloc(list, nr * sizeof(list[0]));
+               list = xrealloc(list, nr * sizeof(list[0]));
                list[nr - 1] = commit;
        }
        total = nr;