Hi,

attached is a bugfix for the newly introduced git_mkstemp() function.

/holger
git_mkstemp() bugfix

---
commit 8cccfa75e0095afd2dd4ec354f2786068c9e7a2f
tree 354e00b03039e0c42284442c9764dcd3bf8f608f
parent d59a6043a8a7aed97c684fb4f14fe5221df1fcaf
author Holger Eitzenberger <[EMAIL PROTECTED]> Mon, 08 Aug 2005 23:29:28 +0200
committer Holger Eitzenberger <[EMAIL PROTECTED]> Mon, 08 Aug 2005 23:29:28 +0200

 path.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/path.c b/path.c
--- a/path.c
+++ b/path.c
@@ -68,8 +68,13 @@ int git_mkstemp(char *path, size_t len, 
 	if ((env = getenv("TMPDIR")) == NULL) {
 		strcpy(pch, "/tmp/");
 		len -= 5;
-	} else
-		len -= snprintf(pch, len, "%s/", env);
+		pch += 5;
+	} else {
+		size_t n = snprintf(pch, len, "%s/", env);
+
+		len -= n;
+		pch += n;
+	}
 
 	safe_strncpy(pch, template, len);
 

Reply via email to