MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / nextc

Function nextc

lib/lua/src/liolib.c:441–451  ·  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

439** Add current char to buffer (if not out of space) and read next one
440*/
441static int nextc (RN *rn) {
442 if (l_unlikely(rn->n >= L_MAXLENNUM)) { /* buffer overflow? */
443 rn->buff[0] = '\0'; /* invalidate result */
444 return 0; /* fail */
445 }
446 else {
447 rn->buff[rn->n++] = rn->c; /* save current char */
448 rn->c = l_getc(rn->f); /* read next one */
449 return 1;
450 }
451}
452
453
454/*

Callers 2

test2Function · 0.85
readdigitsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected