From 648d6426c863c75643d714d45f4b67e19ac6944a Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 9 Sep 2024 05:14:47 -0700 Subject: [PATCH] fix(server): CID 509282: DEADCODE #30316 listen_addr cannot be NULL at this point. --- src/nvim/msgpack_rpc/server.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/nvim/msgpack_rpc/server.c b/src/nvim/msgpack_rpc/server.c index dc2b85154f..7f26fd35cd 100644 --- a/src/nvim/msgpack_rpc/server.c +++ b/src/nvim/msgpack_rpc/server.c @@ -51,10 +51,6 @@ bool server_init(const char *listen_addr) must_free = true; } - if (!listen_addr) { - abort(); // Cannot happen. - } - int rv = server_start(listen_addr); // TODO(justinmk): this is for logging_spec. Can remove this after nvim_log #7062 is merged. @@ -77,7 +73,7 @@ bool server_init(const char *listen_addr) kTrue ? "Failed to --listen: %s: \"%s\"" : "Failed $NVIM_LISTEN_ADDRESS: %s: \"%s\"", rv < 0 ? os_strerror(rv) : (rv == 1 ? "empty address" : "?"), - listen_addr ? listen_addr : "(empty)"); + listen_addr); ok = false; end: @@ -118,6 +114,7 @@ void server_teardown(void) /// - Windows: "\\.\pipe\.." /// - Other: "/tmp/nvim.user/xxx/.." char *server_address_new(const char *name) + FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_RET { static uint32_t count = 0; char fmt[ADDRESS_MAX_SIZE];