MCPcopy Create free account
hub / github.com/NetHack/NetHack / macgets

Function macgets

outdated/sys/mac/macfile.c:306–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

304#if 0 /* this function isn't used, if you use it, uncomment prototype in \
305 macwin.h */
306char *
307macgets (int fd, char *ptr, unsigned len)
308{
309 int idx = 0;
310 char c;
311
312 while (-- len > 0) {
313 if (macread (fd, ptr + idx, 1) <= 0)
314 return (char *)0;
315 c = ptr[idx++];
316 if (c == '\n' || c == '\r')
317 break;
318 }
319 ptr [idx] = '\0';
320 return ptr;
321}
322#endif /* 0 */
323
324int

Callers

nothing calls this directly

Calls 1

macreadFunction · 0.85

Tested by

no test coverage detected