From c3fe018b12e76aae4071b4199d83a0678c3baaaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Tue, 20 Sep 2011 10:02:11 +0200 Subject: [PATCH] repsitory: use better error code if path is too short for discover MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GIT_EOVERFLOW means something different. Use GIT_ESHORTBUFFER. On the way, remove a redundant sizeof(char). Signed-off-by: Carlos Martín Nieto --- src/repository.c | 4 ++-- 1 file 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, "");