Use PATH_MAX instead of TEMPFILE_PATH_LEN
Signed-off-by: Fernando J. Pereda <ferdy@gentoo.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Fernando J. Pereda committed
May 20, 2007 at 15:35 UTC
1472966c04103874096fb786657459ea6628e451
1 file changed
+2
-4
diff.c
+2
-4
@@ -137,13 +137,11 @@ static const char *external_diff(void)
137
return external_diff_cmd;
138
}
139
140
-#define TEMPFILE_PATH_LEN 50
141
-
140
static struct diff_tempfile {
141
const char *name; /* filename external diff should read from */
142
char hex[41];
143
char mode[10];
146
- char tmp_path[TEMPFILE_PATH_LEN];
144
+ char tmp_path[PATH_MAX];
145
} diff_temp[2];
146
147
static int count_lines(const char *data, int size)
@@ -1507,7 +1505,7 @@ static void prep_temp_blob(struct diff_tempfile *temp,
1505
{
1506
int fd;
1507
1510
- fd = git_mkstemp(temp->tmp_path, TEMPFILE_PATH_LEN, ".diff_XXXXXX");
1508
+ fd = git_mkstemp(temp->tmp_path, PATH_MAX, ".diff_XXXXXX");
1509
if (fd < 0)
1510
die("unable to create temp-file");
1511
if (write_in_full(fd, blob, size) != size)