MCPcopy Create free account
hub / github.com/DFHack/dfhack / nextc

Function nextc

depends/lua/src/liolib.c:403–413  ·  view source on GitHub ↗

** Add current char to buffer (if not out of space) and read next one */

Source from the content-addressed store, hash-verified

401** Add current char to buffer (if not out of space) and read next one
402*/
403static int nextc (RN *rn) {
404 if (rn->n >= L_MAXLENNUM) { /* buffer overflow? */
405 rn->buff[0] = '\0'; /* invalidate result */
406 return 0; /* fail */
407 }
408 else {
409 rn->buff[rn->n++] = rn->c; /* save current char */
410 rn->c = l_getc(rn->f); /* read next one */
411 return 1;
412 }
413}
414
415
416/*

Callers 2

test2Function · 0.85
readdigitsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected