Skip to content

Commit

Permalink
Fix AutoPtr misuse
Browse files Browse the repository at this point in the history
  • Loading branch information
Arkshine committed Apr 4, 2015
1 parent e58b1aa commit ae83725
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions module/steamtools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,18 @@ bool SteamTools::IsSteamToolsLoaded()

void SteamTools::SetServerAppID()
{
ke::AutoPtr<FILE> fp;
char lineRead[6];

fp = fopen(MF_BuildPathname("steam_appid.txt"), "rt");
FILE* fp = fopen(MF_BuildPathname("steam_appid.txt"), "rt");

if (fp && fgets(lineRead, sizeof(lineRead) - 1, fp))
if (fp)
{
m_ServerAppID = static_cast<AppId_t>(atoi(lineRead));
if (fgets(lineRead, sizeof(lineRead) - 1, fp))
{
m_ServerAppID = static_cast<AppId_t>(atoi(lineRead));
}

fclose(fp);
}
}

Expand Down

0 comments on commit ae83725

Please sign in to comment.