MCPcopy Create free account
hub / github.com/buggins/coolreader / my_fgets

Function my_fgets

tinydict/tinydict.cpp:311–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

309}
310
311static int my_fgets( char * buf, int size, FILE * f )
312{
313 int i=0;
314 for ( ; i<size; i++ ) {
315 int ch = fgetc( f );
316 if ( ch == '\n' )
317 break;
318 if ( ch > 0 )
319 buf[i] = (char) ch;
320 else
321 break;
322 }
323 buf[i] = 0;
324 return i;
325}
326
327/// factory - reading from index file
328TinyDictWord * TinyDictWord::read( FILE * f, unsigned index )

Callers 1

readMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected