{"action":"created","issue":{"url":"https://api.github.com/repos/pioneerspacesim/pioneer/issues/3373","labels_url":"https://api.github.com/repos/pioneerspacesim/pioneer/issues/3373/labels{/name}","comments_url":"https://api.github.com/repos/pioneerspacesim/pioneer/issues/3373/comments","events_url":"https://api.github.com/repos/pioneerspacesim/pioneer/issues/3373/events","html_url":"https://github.com/pioneerspacesim/pioneer/pull/3373","id":64656362,"number":3373,"title":"Fix stderr redirection","user":{"login":"AMDmi3","id":474217,"avatar_url":"https://avatars.githubusercontent.com/u/474217?v=3","gravatar_id":"","url":"https://api.github.com/users/AMDmi3","html_url":"https://github.com/AMDmi3","followers_url":"https://api.github.com/users/AMDmi3/followers","following_url":"https://api.github.com/users/AMDmi3/following{/other_user}","gists_url":"https://api.github.com/users/AMDmi3/gists{/gist_id}","starred_url":"https://api.github.com/users/AMDmi3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AMDmi3/subscriptions","organizations_url":"https://api.github.com/users/AMDmi3/orgs","repos_url":"https://api.github.com/users/AMDmi3/repos","events_url":"https://api.github.com/users/AMDmi3/events{/privacy}","received_events_url":"https://api.github.com/users/AMDmi3/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-26T23:32:06Z","updated_at":"2015-03-27T00:45:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/pioneerspacesim/pioneer/pulls/3373","html_url":"https://github.com/pioneerspacesim/pioneer/pull/3373","diff_url":"https://github.com/pioneerspacesim/pioneer/pull/3373.diff","patch_url":"https://github.com/pioneerspacesim/pioneer/pull/3373.patch"},"body":"You cannot modify dereferenced FILE, this is UB. FILE may also be\r\nopaque type so this code may not compile (and in fact it doesn't\r\ncompile on DragonFlyBSD). freopen is quite enough to do the thing."},"comment":{"url":"https://api.github.com/repos/pioneerspacesim/pioneer/issues/comments/86774209","html_url":"https://github.com/pioneerspacesim/pioneer/pull/3373#issuecomment-86774209","issue_url":"https://api.github.com/repos/pioneerspacesim/pioneer/issues/3373","id":86774209,"user":{"login":"AMDmi3","id":474217,"avatar_url":"https://avatars.githubusercontent.com/u/474217?v=3","gravatar_id":"","url":"https://api.github.com/users/AMDmi3","html_url":"https://github.com/AMDmi3","followers_url":"https://api.github.com/users/AMDmi3/followers","following_url":"https://api.github.com/users/AMDmi3/following{/other_user}","gists_url":"https://api.github.com/users/AMDmi3/gists{/gist_id}","starred_url":"https://api.github.com/users/AMDmi3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AMDmi3/subscriptions","organizations_url":"https://api.github.com/users/AMDmi3/orgs","repos_url":"https://api.github.com/users/AMDmi3/repos","events_url":"https://api.github.com/users/AMDmi3/events{/privacy}","received_events_url":"https://api.github.com/users/AMDmi3/received_events","type":"User","site_admin":false},"created_at":"2015-03-27T00:45:37Z","updated_at":"2015-03-27T00:45:37Z","body":"> Does freopen preserve buffering modes?\r\n\r\nCan't find explicit statements regarding this in the standard, but my guess is that it doesn't (at least unless first argument is NULL) - it closes the old stream and opens the new one just like fopen will do.\r\n\r\nI've actually missed that setvbuf is called even if freopen succeeds, redoing the patch."}}