mirror of
https://github.com/neovim/neovim.git
synced 2025-10-08 19:06:31 +00:00
Allow server_start to accept a NULL argument
Return 1 if the endpoint argument is NULL, server_start() can get a NULL value when using server_address_new() or vim_tempname(). Removed the function attribute.
This commit is contained in:
@@ -101,8 +101,12 @@ char *server_address_new(void)
|
|||||||
/// @returns 0 on success, 1 on a regular error, and negative errno
|
/// @returns 0 on success, 1 on a regular error, and negative errno
|
||||||
/// on failure to bind or connect.
|
/// on failure to bind or connect.
|
||||||
int server_start(const char *endpoint)
|
int server_start(const char *endpoint)
|
||||||
FUNC_ATTR_NONNULL_ALL
|
|
||||||
{
|
{
|
||||||
|
if (endpoint == NULL) {
|
||||||
|
ELOG("Attempting to start server on NULL endpoint");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
SocketWatcher *watcher = xmalloc(sizeof(SocketWatcher));
|
SocketWatcher *watcher = xmalloc(sizeof(SocketWatcher));
|
||||||
socket_watcher_init(&loop, watcher, endpoint, NULL);
|
socket_watcher_init(&loop, watcher, endpoint, NULL);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user