{"action":"opened","issue":{"url":"https://api.github.com/repos/ladislav-zezula/StormLib/issues/66","labels_url":"https://api.github.com/repos/ladislav-zezula/StormLib/issues/66/labels{/name}","comments_url":"https://api.github.com/repos/ladislav-zezula/StormLib/issues/66/comments","events_url":"https://api.github.com/repos/ladislav-zezula/StormLib/issues/66/events","html_url":"https://github.com/ladislav-zezula/StormLib/issues/66","id":124140221,"number":66,"title":"Cosmetic question about SFileFlushArchive","user":{"login":"Krakean","id":6083925,"avatar_url":"https://avatars.githubusercontent.com/u/6083925?v=3","gravatar_id":"","url":"https://api.github.com/users/Krakean","html_url":"https://github.com/Krakean","followers_url":"https://api.github.com/users/Krakean/followers","following_url":"https://api.github.com/users/Krakean/following{/other_user}","gists_url":"https://api.github.com/users/Krakean/gists{/gist_id}","starred_url":"https://api.github.com/users/Krakean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Krakean/subscriptions","organizations_url":"https://api.github.com/users/Krakean/orgs","repos_url":"https://api.github.com/users/Krakean/repos","events_url":"https://api.github.com/users/Krakean/events{/privacy}","received_events_url":"https://api.github.com/users/Krakean/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-28T23:22:23Z","updated_at":"2015-12-28T23:22:23Z","closed_at":null,"body":"Hi :)\r\n\r\n>    int nResultError = ERROR_SUCCESS;\r\n>    int nError;\r\n1. Why you have additional nError var? Anyway nResultError is overwritten every time, when nError is not ERROR_SUCCESS, so why instead of:\r\n...\r\n            nError = SSignFileCreate(ha);\r\n            if(nError != ERROR_SUCCESS)\r\n                nResultError = nError;\r\n...\r\nto not use just this:\r\n...\r\nnResultError = SSignFileCreate\r\n...\r\n\r\n2. Why you do not check for nResultError == ERROR_SUCCESS in if's like:\r\n        if(ha->dwFlags & MPQ_FLAG_LISTFILE_NEW)\r\n..\r\n        if(ha->dwFlags & MPQ_FLAG_ATTRIBUTES_NEW)\r\n..\r\n        if(ha->dwFlags & MPQ_FLAG_CHANGED)\r\n..\r\nso return control to caller ASAP, so caller will have most first error code. In current case, caller will always have most last error.\r\n\r\n"}}