diff options
author | cjihrig <cjihrig@gmail.com> | 2016-06-27 16:09:46 -0400 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2016-07-14 09:47:23 -0400 |
commit | 840a8c599ec1f138992a538f5b8109f91f31805e (patch) | |
tree | 33f3636526565a189b667c7e64d384680ccbeaa2 /docs/src | |
parent | 70002c80bf1447fad605b61d9d6e83e9d0c1a6bc (diff) | |
download | libuv-840a8c599ec1f138992a538f5b8109f91f31805e.tar.gz libuv-840a8c599ec1f138992a538f5b8109f91f31805e.zip |
unix,win: make uv_get_process_title() stricter
This commit causes uv_get_process_title() to:
- return EINVAL if the buffer is null or size is 0
- return ENOBUFS if the title is too big for the buffer
- null terminate the buffer on success
Fixes: https://github.com/libuv/libuv/issues/315
PR-URL: https://github.com/libuv/libuv/pull/928
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Diffstat (limited to 'docs/src')
-rw-r--r-- | docs/src/misc.rst | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/docs/src/misc.rst b/docs/src/misc.rst index f32af48f..3b7f31aa 100644 --- a/docs/src/misc.rst +++ b/docs/src/misc.rst @@ -183,7 +183,9 @@ API .. c:function:: int uv_get_process_title(char* buffer, size_t size) - Gets the title of the current process. + Gets the title of the current process. If `buffer` is `NULL` or `size` is + zero, `UV_EINVAL` is returned. If `size` cannot accommodate the process + title and terminating `NULL` character, the function returns `UV_ENOBUFS`. .. c:function:: int uv_set_process_title(const char* title) |