increase buf to hold trailing '\0' + better names