summaryrefslogtreecommitdiff
path: root/src/repository.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@elego.de>2011-09-20 10:02:11 +0200
committerCarlos Martín Nieto <cmn@elego.de>2011-09-20 10:02:11 +0200
commitc3fe018b12e76aae4071b4199d83a0678c3baaaa (patch)
treebce7bc1f0a3b27c63b2c51507b3991a8583a0323 /src/repository.c
parentc498701df7700695e287ea0e2f08062f9147b3a6 (diff)
downloadlibgit2-c3fe018b12e76aae4071b4199d83a0678c3baaaa.tar.gz
repsitory: use better error code if path is too short for discover
GIT_EOVERFLOW means something different. Use GIT_ESHORTBUFFER. On the way, remove a redundant sizeof(char). Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Diffstat (limited to 'src/repository.c')
-rw-r--r--src/repository.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/repository.c b/src/repository.c
index bb7ef396d..a39ccb63e 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -558,8 +558,8 @@ int git_repository_discover(char *repository_path, size_t size, const char *star
}
}
- if (size < (strlen(found_path) + 2) * sizeof(char)) {
- return git__throw(GIT_EOVERFLOW, "The repository buffer is not long enough to handle the repository path `%s`", found_path);
+ if (size < strlen(found_path) + 2) {
+ return git__throw(GIT_ESHORTBUFFER, "The repository buffer is not long enough to handle the repository path `%s`", found_path);
}
git_path_join(repository_path, found_path, "");