{"action":"created","issue":{"url":"https://api.github.com/repos/eygilbert/egdb_intl/issues/2","repository_url":"https://api.github.com/repos/eygilbert/egdb_intl","labels_url":"https://api.github.com/repos/eygilbert/egdb_intl/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/eygilbert/egdb_intl/issues/2/comments","events_url":"https://api.github.com/repos/eygilbert/egdb_intl/issues/2/events","html_url":"https://github.com/eygilbert/egdb_intl/issues/2","id":169183640,"number":2,"title":"problem with error return from open_file()","user":{"login":"eygilbert","id":18445826,"avatar_url":"https://avatars.githubusercontent.com/u/18445826?v=3","gravatar_id":"","url":"https://api.github.com/users/eygilbert","html_url":"https://github.com/eygilbert","followers_url":"https://api.github.com/users/eygilbert/followers","following_url":"https://api.github.com/users/eygilbert/following{/other_user}","gists_url":"https://api.github.com/users/eygilbert/gists{/gist_id}","starred_url":"https://api.github.com/users/eygilbert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eygilbert/subscriptions","organizations_url":"https://api.github.com/users/eygilbert/orgs","repos_url":"https://api.github.com/users/eygilbert/repos","events_url":"https://api.github.com/users/eygilbert/events{/privacy}","received_events_url":"https://api.github.com/users/eygilbert/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-03T17:09:29Z","updated_at":"2016-08-03T18:07:41Z","closed_at":null,"body":"When there is an error in open_file(), it returns a nullptr. This is a problem when USE_WIN_API is true because 0 is a valid HANDLE value that can be returned by CreateFile. \r\n\r\nA solution is to add a second argument to open_file(), passed by reference, to return the FILE_HANDLE value, and use the return value of the open_file() function to indicate error status."},"comment":{"url":"https://api.github.com/repos/eygilbert/egdb_intl/issues/comments/237319742","html_url":"https://github.com/eygilbert/egdb_intl/issues/2#issuecomment-237319742","issue_url":"https://api.github.com/repos/eygilbert/egdb_intl/issues/2","id":237319742,"user":{"login":"rhalbersma","id":951511,"avatar_url":"https://avatars.githubusercontent.com/u/951511?v=3","gravatar_id":"","url":"https://api.github.com/users/rhalbersma","html_url":"https://github.com/rhalbersma","followers_url":"https://api.github.com/users/rhalbersma/followers","following_url":"https://api.github.com/users/rhalbersma/following{/other_user}","gists_url":"https://api.github.com/users/rhalbersma/gists{/gist_id}","starred_url":"https://api.github.com/users/rhalbersma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhalbersma/subscriptions","organizations_url":"https://api.github.com/users/rhalbersma/orgs","repos_url":"https://api.github.com/users/rhalbersma/repos","events_url":"https://api.github.com/users/rhalbersma/events{/privacy}","received_events_url":"https://api.github.com/users/rhalbersma/received_events","type":"User","site_admin":false},"created_at":"2016-08-03T18:07:41Z","updated_at":"2016-08-03T18:07:41Z","body":"I don't see the problem, `open_file` first checks the return value from `CreateFile` equality to `INVALID_HANDLE_VALUE` before returning `nullptr`. IMO, all callers of `open_file` should be checking against `nulltpr`, not against `INVALID_HANDLE_VALUE`. This is consistent with the `std::fopen` interface."}}
{"actor":{"display_login":"rhalbersma"}}