skydevgit / crisscross

Automatically exported from code.google.com/p/crisscross
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Filesystem::FileExists method broken #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It tries to fclose when FILE *file is NULL (not cool!)

Original issue reported on code.google.com by omo...@gmail.com on 6 Dec 2006 at 4:46

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed, using a slightly different change.

        bool
        FileExists ( std::string path )
        {
            FILE *file;
            file = fopen ( path.c_str(), "r" );
            if ( file == NULL )
                return false;
            fclose ( file );
            return true;
        }

Original comment by steven.n...@gmail.com on 7 Dec 2006 at 4:27

GoogleCodeExporter commented 9 years ago
Even shorter, good job :P

Original comment by omo...@gmail.com on 7 Dec 2006 at 3:11

GoogleCodeExporter commented 9 years ago

Original comment by steven.n...@gmail.com on 20 May 2007 at 9:50