Three functions: need(n), take(n), remain(). Every parser bug I still write is because I did not use them.
Paste yours. I will paste mine. We will argue about names.
static int need(buf *b, size_t n) { return b->n - b->i >= n; }Refs: CVE Program
Lab / educational. Public binaries and patched classes only. Isolated VM.