server-info: throw away T computation as well.
[gitweb.git] / git.c
diff --git a/git.c b/git.c
index 878c359704dca8591755a68ff5a826503c017b3e..ee5048aaaa2f814f00a6a3fb937bf0d15e46f50c 100644 (file)
--- a/git.c
+++ b/git.c
 # define PATH_MAX 4096
 #endif
 
+#ifdef NO_SETENV
+extern int gitsetenv(const char *, const char *, int);
+#endif
+
 static const char git_usage[] =
        "Usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [--help] COMMAND [ ARGS ]";
 
@@ -188,7 +192,6 @@ static void prepend_to_path(const char *dir, int len)
        path_len = len + strlen(old_path) + 1;
 
        path = malloc(path_len + 1);
-       path[path_len + 1] = '\0';
 
        memcpy(path, dir, len);
        path[len] = ':';
@@ -286,7 +289,7 @@ int main(int argc, char **argv, char **envp)
        len += snprintf(git_command + len, sizeof(git_command) - len,
                        "/git-%s", argv[i]);
        if (sizeof(git_command) <= len) {
-               fprintf(stderr, "git: command name given is too long (%d)\n", len);
+               fprintf(stderr, "git: command name given is too long.\n");
                exit(1);
        }