Commit d1317f1b69cafb328ca9b263b2b71cddeb2290be

Vicent Martí 2012-01-17T11:01:04

Merge pull request #536 from nulltoken/fix/transport-segfault Fix transport segfault

diff --git a/src/repository.c b/src/repository.c
index a408599..67bfcc9 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -169,7 +169,7 @@ int git_repository_open(git_repository **repo_out, const char *path)
 
 	if (quickcheck_repository_dir(&path_buf) < GIT_SUCCESS) {
 		error = git__throw(GIT_ENOTAREPO,
-			"The given path is not a valid Git repository");
+			"The given path (%s) is not a valid Git repository", git_buf_cstr(&path_buf));
 		goto cleanup;
 	}
 
diff --git a/src/transport.c b/src/transport.c
index d836561..00b79dc 100644
--- a/src/transport.c
+++ b/src/transport.c
@@ -23,7 +23,7 @@ static struct {
 	{NULL, 0}
 };
 
-#define GIT_TRANSPORT_COUNT (sizeof(transports)/sizeof(transports[0]))
+#define GIT_TRANSPORT_COUNT (sizeof(transports)/sizeof(transports[0])) - 1
 
 static git_transport_cb transport_find_fn(const char *url)
 {
diff --git a/src/win32/posix_w32.c b/src/win32/posix_w32.c
index f68742f..3786f01 100644
--- a/src/win32/posix_w32.c
+++ b/src/win32/posix_w32.c
@@ -80,7 +80,7 @@ static int do_lstat(const char *file_name, struct stat *buf)
 		buf->st_uid = 0;
 		buf->st_nlink = 1;
 		buf->st_mode = (mode_t)fMode;
-		buf->st_size = (fdata.nFileSizeHigh << 32) + fdata.nFileSizeLow;
+		buf->st_size = ((git_off_t)fdata.nFileSizeHigh << 32) + fdata.nFileSizeLow;
 		buf->st_dev = buf->st_rdev = (_getdrive() - 1);
 		buf->st_atime = filetime_to_time_t(&(fdata.ftLastAccessTime));
 		buf->st_mtime = filetime_to_time_t(&(fdata.ftLastWriteTime));