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

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

prep_temp_blob: use git_mkstemp() instead of mkstemp()

/holger

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

prep_temp_blob: use git_mkstemp() instead of mkstemp()

---
commit 43bac92063c8dd8d88b33cb838530d4bb3dcad25
tree aeb8bdc2aa285df1fc4888e66fe88b4a8a5e2b3b
parent 1a1f2cb5c27ed26e6ef8dd34209e561bdf256c22
author Holger Eitzenberger <holger@my-eitzenberger.de> Thu, 04 Aug 2005 22:30:43 +0200
committer Holger Eitzenberger <holger@elmo.intranet.astaro.de> Thu, 04 Aug 2005 22:30:43 +0200

 diff.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/diff.c b/diff.c
--- a/diff.c
+++ b/diff.c
@@ -41,11 +41,13 @@ static const char *external_diff(void)
 	return external_diff_cmd;
 }
 
+#define TEMPFILE_PATH_LEN		50
+
 static struct diff_tempfile {
 	const char *name; /* filename external diff should read from */
 	char hex[41];
 	char mode[10];
-	char tmp_path[50];
+	char tmp_path[TEMPFILE_PATH_LEN];
 } diff_temp[2];
 
 static int count_lines(const char *filename)
@@ -421,8 +423,7 @@ static void prep_temp_blob(struct diff_t
 {
 	int fd;
 
-	strcpy(temp->tmp_path, ".diff_XXXXXX");
-	fd = mkstemp(temp->tmp_path);
+	fd = git_mkstemp(temp->tmp_path, TEMPFILE_PATH_LEN, ".diff_XXXXXX");
 	if (fd < 0)
 		die("unable to create temp-file");
 	if (write(fd, blob, size) != size)

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

only message in thread, other threads:[~2005-08-04 23:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-04 20:49 [PATCH 1/1] git: use git_mkstemp() instead of mkstemp() 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).