GitHub PullRequestReviewCommentEvent at 2014-05-28 13:39:54
Repository: neovim
Actor: aktau
Payload: {"comment":{"url":"https://api.github.com/repos/neovim/neovim/pulls/comments/13130944","id":13130944,"diff_hunk":"@@ -327,6 +328,24 @@ void vim_set_current_tabpage(Tabpage tabpage, Error *err)\n   try_end(err);\n }\n \n+void vim_subscribe(uint64_t channel_id, String event)\n+{\n+  size_t length = (event.size < EVENT_MAXLEN ? event.size : EVENT_MAXLEN);\n+  char e[EVENT_MAXLEN + 1];\n+  memcpy(e, event.data, length);\n+  e[length] = NUL;","path":"src/nvim/api/vim.c","position":17,"original_position":17,"commit_id":"cd8421537034d0b5cc567d81afc4fa5316da171e","original_commit_id":"cd8421537034d0b5cc567d81afc4fa5316da171e","user":{"login":"aktau","id":189413,"avatar_url":"https://avatars.githubusercontent.com/u/189413?","gravatar_id":"7b04c723316dd727866faa8d79962e77","url":"https://api.github.com/users/aktau","html_url":"https://github.com/aktau","followers_url":"https://api.github.com/users/aktau/followers","following_url":"https://api.github.com/users/aktau/following{/other_user}","gists_url":"https://api.github.com/users/aktau/gists{/gist_id}","starred_url":"https://api.github.com/users/aktau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aktau/subscriptions","organizations_url":"https://api.github.com/users/aktau/orgs","repos_url":"https://api.github.com/users/aktau/repos","events_url":"https://api.github.com/users/aktau/events{/privacy}","received_events_url":"https://api.github.com/users/aktau/received_events","type":"User","site_admin":false},"body":"Btw @tarruda this is probably a good candidate for abstracting into a `string_to_cstr()` function.\r\n\r\n```c\r\n// copy a String into a char buffer of size `len` and make sure it's NULL-terminated\r\nchar *string_to_cstr_len(String str, char *restrict buf, size_t len) {\r\n  size_t min_len = (str.size < len) ? str.size : len;\r\n  memcpy(buf, str.data, min_len);\r\n  buf[min_len] = NUL;\r\n  return buf;\r\n}\r\n```","created_at":"2014-05-28T13:39:54Z","updated_at":"2014-05-28T13:39:54Z","html_url":"https://github.com/neovim/neovim/pull/768#discussion_r13130944","pull_request_url":"https://api.github.com/repos/neovim/neovim/pulls/768","_links":{"self":{"href":"https://api.github.com/repos/neovim/neovim/pulls/comments/13130944"},"html":{"href":"https://github.com/neovim/neovim/pull/768#discussion_r13130944"},"pull_request":{"href":"https://api.github.com/repos/neovim/neovim/pulls/768"}}}}