Changeset 2363


Ignore:
Timestamp:
Feb 5, 2013, 12:01:43 PM (6 years ago)
Author:
sam
Message:

sys: be more resilient if the file we try to read doesn’t exist.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sys/file.cpp

    r2362 r2363  
    3636#if __CELLOS_LV2__
    3737#elif HAVE_STDIO_H
    38         while (!feof(m_fd))
     38        while (m_fd && !feof(m_fd))
    3939        {
    4040            char buf[BUFSIZ];
     
    5555#if __CELLOS_LV2__
    5656#elif HAVE_STDIO_H
    57         fclose(m_fd);
     57        if (m_fd)
     58            fclose(m_fd);
     59        m_fd = NULL;
    5860#endif
    5961    }
Note: See TracChangeset for help on using the changeset viewer.