{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/osquery/issues/589","labels_url":"https://api.github.com/repos/facebook/osquery/issues/589/labels{/name}","comments_url":"https://api.github.com/repos/facebook/osquery/issues/589/comments","events_url":"https://api.github.com/repos/facebook/osquery/issues/589/events","html_url":"https://github.com/facebook/osquery/pull/589","id":53782433,"number":589,"title":"Use sizeof for length of statically allocated arrays","user":{"login":"zwass","id":575602,"avatar_url":"https://avatars.githubusercontent.com/u/575602?v=3","gravatar_id":"","url":"https://api.github.com/users/zwass","html_url":"https://github.com/zwass","followers_url":"https://api.github.com/users/zwass/followers","following_url":"https://api.github.com/users/zwass/following{/other_user}","gists_url":"https://api.github.com/users/zwass/gists{/gist_id}","starred_url":"https://api.github.com/users/zwass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zwass/subscriptions","organizations_url":"https://api.github.com/users/zwass/orgs","repos_url":"https://api.github.com/users/zwass/repos","events_url":"https://api.github.com/users/zwass/events{/privacy}","received_events_url":"https://api.github.com/users/zwass/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/osquery/labels/in+progress","name":"in progress","color":"f7c6c7"}],"state":"closed","locked":false,"assignee":{"login":"zwass","id":575602,"avatar_url":"https://avatars.githubusercontent.com/u/575602?v=3","gravatar_id":"","url":"https://api.github.com/users/zwass","html_url":"https://github.com/zwass","followers_url":"https://api.github.com/users/zwass/followers","following_url":"https://api.github.com/users/zwass/following{/other_user}","gists_url":"https://api.github.com/users/zwass/gists{/gist_id}","starred_url":"https://api.github.com/users/zwass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zwass/subscriptions","organizations_url":"https://api.github.com/users/zwass/orgs","repos_url":"https://api.github.com/users/zwass/repos","events_url":"https://api.github.com/users/zwass/events{/privacy}","received_events_url":"https://api.github.com/users/zwass/received_events","type":"User","site_admin":false},"milestone":null,"comments":7,"created_at":"2015-01-08T18:17:35Z","updated_at":"2015-01-20T19:09:44Z","closed_at":"2015-01-20T18:47:39Z","pull_request":{"url":"https://api.github.com/repos/facebook/osquery/pulls/589","html_url":"https://github.com/facebook/osquery/pull/589","diff_url":"https://github.com/facebook/osquery/pull/589.diff","patch_url":"https://github.com/facebook/osquery/pull/589.patch"},"body":"In some places arrays are statically allocated, then their length is passed as a number in a call like `memset`. We should prefer using `sizeof` when working with statically allocated arrays, as the compiler will automatically pass the correct value, and we will no longer need to ensure consistency between multiple numbers.\r\n\r\nExamples:\r\nhttps://github.com/facebook/osquery/blob/b74ce26a8c5f8c47e76b925a9437ca961a85ad9c/osquery/tables/system/linux/processes.cpp#L40\r\nhttps://github.com/facebook/osquery/blob/b74ce26a8c5f8c47e76b925a9437ca961a85ad9c/osquery/tables/system/darwin/nvram.cpp#L27\r\nhttps://github.com/facebook/osquery/blob/454fb01e98a658dafe18cc7ffc7eed6ff9e085de/osquery/core/system.cpp#L46\r\nhttps://github.com/facebook/osquery/blob/454fb01e98a658dafe18cc7ffc7eed6ff9e085de/osquery/core/system.cpp#L62"},"comment":{"url":"https://api.github.com/repos/facebook/osquery/issues/comments/70712696","html_url":"https://github.com/facebook/osquery/pull/589#issuecomment-70712696","issue_url":"https://api.github.com/repos/facebook/osquery/issues/589","id":70712696,"user":{"login":"zwass","id":575602,"avatar_url":"https://avatars.githubusercontent.com/u/575602?v=3","gravatar_id":"","url":"https://api.github.com/users/zwass","html_url":"https://github.com/zwass","followers_url":"https://api.github.com/users/zwass/followers","following_url":"https://api.github.com/users/zwass/following{/other_user}","gists_url":"https://api.github.com/users/zwass/gists{/gist_id}","starred_url":"https://api.github.com/users/zwass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zwass/subscriptions","organizations_url":"https://api.github.com/users/zwass/orgs","repos_url":"https://api.github.com/users/zwass/repos","events_url":"https://api.github.com/users/zwass/events{/privacy}","received_events_url":"https://api.github.com/users/zwass/received_events","type":"User","site_admin":false},"created_at":"2015-01-20T19:09:44Z","updated_at":"2015-01-20T19:09:44Z","body":"This is ready to go. I would merge, but prefer that someone else take a look first."}}