{"thread":{"id":"2745","subject":"git.c: two fixes, gitsetenv type and off-by-one error.","startedAt":"2005-12-04T23:03:13Z","lastAt":"2005-12-04T23:03:13Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"13185","messageId":"7vhd9oea8e.fsf@assigned-by-dhcp.cox.net","threadId":"2745","inReplyTo":null,"subject":"git.c: two fixes, gitsetenv type and off-by-one error.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-12-04T23:03:13Z","receivedAt":"2005-12-04T23:03:13Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"gitsetenv as implemented in compat/setenv.c takes two const char*\nand int; match that.\n\nAlso fix an incorrect attempt in prepend_to_path() to\nNUL-terminate the string which stuffed the NUL character at one\npast the end of allocation, and was not needed to begin with (we\ncopy the old_path string including the NUL which terminates it).\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\n---\n\n git.c |    3 +--\n 1 files changed, 1 insertions(+), 2 deletions(-)\n\n9a79c5a8b4e280601bcbeeed22e1e4968d06c10e\ndiff --git a/git.c b/git.c\nindex 619f25a..0975fc7 100644\n--- a/git.c\n+++ b/git.c\n@@ -14,7 +14,7 @@\n #endif\n \n #ifdef NO_SETENV\n-extern int gitsetenv(char *name, char *value, int overwrite);\n+extern int gitsetenv(const char *, const char *, int);\n #endif\n \n static const char git_usage[] =\n@@ -192,7 +192,6 @@ static void prepend_to_path(const char *\n \tpath_len = len + strlen(old_path) + 1;\n \n \tpath = malloc(path_len + 1);\n-\tpath[path_len + 1] = '\\0';\n \n \tmemcpy(path, dir, len);\n \tpath[len] = ':';\n-- \n0.99.9.GIT\n"}]}