mirror of
https://git.proxmox.com/git/libgit2
synced 2025-06-19 22:20:55 +00:00
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>
This commit is contained in:
parent
c498701df7
commit
c3fe018b12
@ -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, "");
|
||||
|
Loading…
Reference in New Issue
Block a user