Code

gitweb: Lift any characters restriction on searched strings
[git.git] / fast-import.c
index 5085fbf116e57a59f488afa3f0055c9427efb3c9..078079d404d8245d73ea8ef36d764f2bb311d0a9 100644 (file)
@@ -375,7 +375,7 @@ static void write_branch_report(FILE *rpt, struct branch *b)
        fputc('\n', rpt);
 }
 
-static void write_crash_report(const char *err, va_list params)
+static void write_crash_report(const char *err)
 {
        char *loc = git_path("fast_import_crash_%d", getpid());
        FILE *rpt = fopen(loc, "w");
@@ -397,7 +397,7 @@ static void write_crash_report(const char *err, va_list params)
        fputc('\n', rpt);
 
        fputs("fatal: ", rpt);
-       vfprintf(rpt, err, params);
+       fputs(err, rpt);
        fputc('\n', rpt);
 
        fputc('\n', rpt);
@@ -442,16 +442,17 @@ static void write_crash_report(const char *err, va_list params)
 static NORETURN void die_nicely(const char *err, va_list params)
 {
        static int zombie;
+       char message[2 * PATH_MAX];
 
+       vsnprintf(message, sizeof(message), err, params);
        fputs("fatal: ", stderr);
-       vfprintf(stderr, err, params);
+       fputs(message, stderr);
        fputc('\n', stderr);
 
        if (!zombie) {
                zombie = 1;
-               write_crash_report(err, params);
+               write_crash_report(message);
        }
-
        exit(128);
 }
 
@@ -1618,7 +1619,7 @@ static void read_next_command(void)
        } while (command_buf.buf[0] == '#');
 }
 
-static void skip_optional_lf()
+static void skip_optional_lf(void)
 {
        int term_char = fgetc(stdin);
        if (term_char != '\n' && term_char != EOF)