git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] git_mkstemp() fix
@ 2005-08-08 20:33 Holger Eitzenberger
  0 siblings, 0 replies; only message in thread
From: Holger Eitzenberger @ 2005-08-08 20:33 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 84 bytes --]

Hi,

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

/holger

[-- Attachment #2: git_mkstemp_fix.patch --]
[-- Type: text/x-patch, Size: 819 bytes --]

git_mkstemp() bugfix

---
commit 8cccfa75e0095afd2dd4ec354f2786068c9e7a2f
tree 354e00b03039e0c42284442c9764dcd3bf8f608f
parent d59a6043a8a7aed97c684fb4f14fe5221df1fcaf
author Holger Eitzenberger <holger@my-eitzenberger.de> Mon, 08 Aug 2005 23:29:28 +0200
committer Holger Eitzenberger <holger@jonathan.my-eitzenberger.de> 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);
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-08-08 20:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-08 20:33 [PATCH 1/1] git_mkstemp() fix Holger Eitzenberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).