Logo Search packages:      
Sourcecode: plib version File versions

char * ObjLoader::fgets ( char *  s,
int  size,
FILE *  fp 
) [private]

XPlane object files have either IBM (
) or Apple () line endings. Handle both here.

Definition at line 132 of file ssgLoadXPlaneObj.cxx.

Referenced by getline().

{
    char* p = s;
    int n = 0;
    int c = 0;

    for (--size; n < size; ++n)
    {
      c = getc(fp);
      if (c == EOF)
          return 0;

      if (c == '\r')
          break;
      *p++ = c;
    }

    *p = 0;

    c = getc(fp);
    if (c != '\n')
      ungetc( c, fp );

    return s;
}


Generated by  Doxygen 1.6.0   Back to index