MCPcopy Create free account
hub / github.com/Singular/Singular / myfread

Function myfread

resources/feFopen.cc:195–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193// replace "\r\n" by " \n" and "\r" by "\n"
194
195size_t myfread(void *ptr, size_t size, size_t nmemb, FILE *stream)
196{
197 size_t got = fread(ptr, size, nmemb, stream) * size;
198 size_t i;
199
200 for (i=0; i<got; i++)
201 {
202 if ( ((char*) ptr)[i] == '\r')
203 {
204 if (i+1 < got && ((char*) ptr)[i+1] == '\n')
205 ((char*) ptr)[i] = ' ';
206 else
207 ((char*) ptr)[i] = '\n';
208 }
209 }
210 return got;
211}

Callers 5

libreadFunction · 0.85
copy_stringFunction · 0.85
sdb_editFunction · 0.85
iiGetLibProcBufferFunction · 0.85
slReadAscii2Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected