daemon: use cld->env_array when re-spawning
[gitweb.git] / builtin / merge-index.c
index b416d928492c43e78dc7ac0b3bd1d7a99abfe78b..1d6611191791ff66822b4a534e3c8dd1a6b9e473 100644 (file)
@@ -23,7 +23,7 @@ static int merge_entry(int pos, const char *path)
                        break;
                found++;
                strcpy(hexbuf[stage], sha1_to_hex(ce->sha1));
-               sprintf(ownbuf[stage], "%o", ce->ce_mode);
+               xsnprintf(ownbuf[stage], sizeof(ownbuf[stage]), "%o", ce->ce_mode);
                arguments[stage] = hexbuf[stage];
                arguments[stage + 4] = ownbuf[stage];
        } while (++pos < active_nr);
@@ -75,7 +75,7 @@ int cmd_merge_index(int argc, const char **argv, const char *prefix)
        signal(SIGCHLD, SIG_DFL);
 
        if (argc < 3)
-               usage("git merge-index [-o] [-q] <merge-program> (-a | [--] <filename>*)");
+               usage("git merge-index [-o] [-q] <merge-program> (-a | [--] [<filename>...])");
 
        read_cache();