win: simplify memory copy logic in fs.c
Hopefully shuts up a -Wmaybe-uninitialized warning about the path_len variable. Fixes: https://github.com/libuv/libuv/issues/941 PR-URL: https://github.com/libuv/libuv/pull/942 Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This commit is contained in:
parent
ef6f3e8e8d
commit
f614b43a69
@ -204,14 +204,11 @@ INLINE static int fs__capture_path(uv_fs_t* req, const char* path,
|
||||
req->fs.info.new_pathw = NULL;
|
||||
}
|
||||
|
||||
if (!copy_path) {
|
||||
req->path = path;
|
||||
} else if (path) {
|
||||
req->path = path;
|
||||
if (path != NULL && copy_path) {
|
||||
memcpy(pos, path, path_len);
|
||||
assert(path_len == buf_sz - (pos - buf));
|
||||
req->path = pos;
|
||||
} else {
|
||||
req->path = NULL;
|
||||
}
|
||||
|
||||
req->flags |= UV_FS_FREE_PATHS;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user