diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-05-26 13:39:16 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-05-26 14:02:12 -0300 |
commit | d6291894d48c2ae558a603a2207c52833ce10f01 (patch) | |
tree | 2ff6bd9d19d2dc8ebacf60e2c73e200e618db9a8 | |
parent | 3f990f1afb75ff6b15e6a5b729f71779d71fba37 (diff) | |
download | rneovim-d6291894d48c2ae558a603a2207c52833ce10f01.tar.gz rneovim-d6291894d48c2ae558a603a2207c52833ce10f01.tar.bz2 rneovim-d6291894d48c2ae558a603a2207c52833ce10f01.zip |
Build: Add more files to clint-files.txt and fix errors
-rw-r--r-- | clint-files.txt | 12 | ||||
-rw-r--r-- | src/nvim/api/private/defs.h | 6 | ||||
-rw-r--r-- | src/nvim/api/private/handle.h | 6 | ||||
-rw-r--r-- | src/nvim/api/private/helpers.h | 6 | ||||
-rw-r--r-- | src/nvim/os/channel.c | 4 | ||||
-rw-r--r-- | src/nvim/os/server.c | 4 | ||||
-rw-r--r-- | src/nvim/os/server.h | 2 |
7 files changed, 23 insertions, 17 deletions
diff --git a/clint-files.txt b/clint-files.txt index c26ca9b964..e05912d338 100644 --- a/clint-files.txt +++ b/clint-files.txt @@ -1,8 +1,10 @@ src/nvim/api/buffer.c src/nvim/api/buffer.h -src/nvim/api/defs.h -src/nvim/api/helpers.c -src/nvim/api/helpers.h +src/nvim/api/private/defs.h +src/nvim/api/private/helpers.c +src/nvim/api/private/helpers.h +src/nvim/api/private/handle.c +src/nvim/api/private/handle.h src/nvim/api/tabpage.c src/nvim/api/tabpage.h src/nvim/api/vim.c @@ -40,3 +42,7 @@ src/nvim/os/signal.c src/nvim/os/signal.h src/nvim/os/time.c src/nvim/os/time.h +src/nvim/os/server.c +src/nvim/os/server.h +src/nvim/os/channel.c +src/nvim/os/channel.h 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. |