If you changed this to `if (n <= 0 || slen == 0) return;` then you could make `len` and `slen` into `size_t`'s right?