diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/msgpack_rpc/helpers.c | 7 | ||||
-rw-r--r-- | src/nvim/os/win_defs.h | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/nvim/msgpack_rpc/helpers.c b/src/nvim/msgpack_rpc/helpers.c index a119c4653a..5ef81721d4 100644 --- a/src/nvim/msgpack_rpc/helpers.c +++ b/src/nvim/msgpack_rpc/helpers.c @@ -94,10 +94,9 @@ bool msgpack_rpc_to_string(msgpack_object *obj, String *arg) FUNC_ATTR_NONNULL_ALL { if (obj->type == MSGPACK_OBJECT_BIN || obj->type == MSGPACK_OBJECT_STR) { - if (obj->via.bin.ptr == NULL) { - return false; - } - arg->data = xmemdupz(obj->via.bin.ptr, obj->via.bin.size); + arg->data = obj->via.bin.ptr != NULL + ? xmemdupz(obj->via.bin.ptr, obj->via.bin.size) + : NULL; arg->size = obj->via.bin.size; return true; } diff --git a/src/nvim/os/win_defs.h b/src/nvim/os/win_defs.h index aad9672ba7..9f9e5e277c 100644 --- a/src/nvim/os/win_defs.h +++ b/src/nvim/os/win_defs.h @@ -3,6 +3,7 @@ #include <windows.h> #include <sys/stat.h> +#include <stdio.h> #define TEMP_DIR_NAMES {"$TMP", "$TEMP", "$USERPROFILE", ""} #define TEMP_FILE_PATH_MAXLEN _MAX_PATH @@ -18,6 +19,12 @@ # ifndef restrict # define restrict __restrict # endif +# ifndef STDOUT_FILENO +# define STDOUT_FILENO _fileno(stdout) +# endif +# ifndef STDERR_FILENO +# define STDERR_FILENO _fileno(stderr) +# endif # ifndef S_IXUSR # define S_IXUSR S_IEXEC # endif |