aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/api/private/defs.h6
-rw-r--r--src/nvim/api/private/handle.h6
-rw-r--r--src/nvim/api/private/helpers.h6
-rw-r--r--src/nvim/os/channel.c4
-rw-r--r--src/nvim/os/server.c4
-rw-r--r--src/nvim/os/server.h2
6 files changed, 14 insertions, 14 deletions
diff --git a/src/nvim/api/private/defs.h b/src/nvim/api/private/defs.h
index 4d9f5fb708..fbf9018043 100644
--- a/src/nvim/api/private/defs.h
+++ b/src/nvim/api/private/defs.h
@@ -1,5 +1,5 @@
-#ifndef NVIM_API_DEFS_H
-#define NVIM_API_DEFS_H
+#ifndef NVIM_API_PRIVATE_DEFS_H
+#define NVIM_API_PRIVATE_DEFS_H
#include <stdint.h>
#include <stdbool.h>
@@ -85,5 +85,5 @@ struct key_value_pair {
};
-#endif // NVIM_API_DEFS_H
+#endif // NVIM_API_PRIVATE_DEFS_H
diff --git a/src/nvim/api/private/handle.h b/src/nvim/api/private/handle.h
index 27df453233..1a196f6797 100644
--- a/src/nvim/api/private/handle.h
+++ b/src/nvim/api/private/handle.h
@@ -1,5 +1,5 @@
-#ifndef NVIM_API_HANDLE_H
-#define NVIM_API_HANDLE_H
+#ifndef NVIM_API_PRIVATE_HANDLE_H
+#define NVIM_API_PRIVATE_HANDLE_H
#include "nvim/vim.h"
#include "nvim/buffer_defs.h"
@@ -16,5 +16,5 @@ HANDLE_DECLS(tabpage_T, tabpage)
void handle_init(void);
-#endif // NVIM_API_HANDLE_H
+#endif // NVIM_API_PRIVATE_HANDLE_H
diff --git a/src/nvim/api/private/helpers.h b/src/nvim/api/private/helpers.h
index 2d917c2b5e..04b128d3f1 100644
--- a/src/nvim/api/private/helpers.h
+++ b/src/nvim/api/private/helpers.h
@@ -1,5 +1,5 @@
-#ifndef NVIM_API_HELPERS_H
-#define NVIM_API_HELPERS_H
+#ifndef NVIM_API_PRIVATE_HELPERS_H
+#define NVIM_API_PRIVATE_HELPERS_H
#include <stdbool.h>
@@ -94,5 +94,5 @@ tabpage_T * find_tab(Tabpage tabpage, Error *err);
/// empty String is returned
String cstr_to_string(const char *str);
-#endif // NVIM_API_HELPERS_H
+#endif // NVIM_API_PRIVATE_HELPERS_H
diff --git a/src/nvim/os/channel.c b/src/nvim/os/channel.c
index 4981a268b2..f275c70805 100644
--- a/src/nvim/os/channel.c
+++ b/src/nvim/os/channel.c
@@ -177,9 +177,9 @@ static void parse_msgpack(RStream *rstream, void *data, bool eof)
msgpack_unpacked unpacked;
msgpack_unpacked_init(&unpacked);
- // Deserialize everything we can.
+ // Deserialize everything we can.
while (msgpack_unpacker_next(channel->proto.msgpack.unpacker, &unpacked)) {
- // Each object is a new msgpack-rpc request and requires an empty response
+ // Each object is a new msgpack-rpc request and requires an empty response
msgpack_packer response;
msgpack_packer_init(&response,
channel->proto.msgpack.sbuffer,
diff --git a/src/nvim/os/server.c b/src/nvim/os/server.c
index b2faa49a86..7b2326556c 100644
--- a/src/nvim/os/server.c
+++ b/src/nvim/os/server.c
@@ -123,8 +123,8 @@ void server_start(char *endpoint, ChannelProtocol prot)
char *port_end;
// Extract the port
port = strtol(ip_end + 1, &port_end, 10);
-
errno = 0;
+
if (errno != 0 || port == 0 || port > 0xffff) {
// Invalid port, treat as named pipe or unix socket
server_type = kServerTypePipe;
@@ -156,7 +156,7 @@ void server_start(char *endpoint, ChannelProtocol prot)
}
} else {
// Listen on named pipe or unix socket
- strcpy(server->socket.pipe.addr, addr);
+ xstrlcpy(server->socket.pipe.addr, addr, sizeof(server->socket.pipe.addr));
uv_pipe_init(uv_default_loop(), &server->socket.pipe.handle, 0);
server->socket.pipe.handle.data = server;
uv_pipe_bind(&server->socket.pipe.handle, server->socket.pipe.addr);
diff --git a/src/nvim/os/server.h b/src/nvim/os/server.h
index 541746eb5f..73c6bd1fea 100644
--- a/src/nvim/os/server.h
+++ b/src/nvim/os/server.h
@@ -10,7 +10,7 @@ void server_init();
void server_teardown();
/// Starts listening on arbitrary tcp/unix addresses specified by
-/// `endpoint` for API calls. The type of socket used(tcp or unix/pipe) will
+/// `endpoint` for API calls. The type of socket used(tcp or unix/pipe) will
/// be determined by parsing `endpoint`: If it's a valid tcp address in the
/// 'ip:port' format, then it will be tcp socket, else it will be a unix
/// socket or named pipe.