In my book `snprintf` returns an int and can actually return a negative value on failure. So the correct fix would be to make `l` of type `int` and not `size_t`.