mirror of
https://github.com/neovim/neovim.git
synced 2025-09-14 15:28:17 +00:00
Remove unnecessary assert() in os_dirname().
Compiler warns about buf always being nonnull. buf is per function attribute always nonnull, so buf can be removed from the assert(). But a buffer length of zero is also no problem, because it makes uv_cwd() return a failure without writing into buf. So the remaining length check can also be removed.
This commit is contained in:
@@ -42,8 +42,6 @@ int os_chdir(const char *path)
|
|||||||
int os_dirname(char_u *buf, size_t len)
|
int os_dirname(char_u *buf, size_t len)
|
||||||
FUNC_ATTR_NONNULL_ALL
|
FUNC_ATTR_NONNULL_ALL
|
||||||
{
|
{
|
||||||
assert(buf && len);
|
|
||||||
|
|
||||||
int error_number;
|
int error_number;
|
||||||
if ((error_number = uv_cwd((char *)buf, &len)) != kLibuvSuccess) {
|
if ((error_number = uv_cwd((char *)buf, &len)) != kLibuvSuccess) {
|
||||||
STRLCPY(buf, uv_strerror(error_number), len);
|
STRLCPY(buf, uv_strerror(error_number), len);
|
||||||
|
Reference in New Issue
Block a user