save a bit of code with *strchrnul = '\0' trick