Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
uv: Upgrade to b49d6f7
  • Loading branch information
isaacs committed Jul 18, 2012
1 parent 648fdc5 commit e1fb7b7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion deps/uv/src/unix/proctitle.c
Expand Up @@ -81,7 +81,14 @@ char** uv_setup_args(int argc, char** argv) {


uv_err_t uv_set_process_title(const char* title) {
uv_strlcpy(process_title.str, title, process_title.len);
/* proctitle doesn't need to be zero terminated, last char is always '\0'.
* Use strncpy(), it pads the remainder with nul bytes. Avoids garbage output
* on systems where `ps aux` prints the entire proctitle buffer, not just the
* characters up to the first '\0'.
*/
if (process_title.len > 0)
strncpy(process_title.str, title, process_title.len - 1);

return uv_ok_;
}

Expand Down

0 comments on commit e1fb7b7

Please sign in to comment.