`strlcpy(vbuff, statedir, CFBUFSIZE)` or just use statedir in place of vbuff in the call to stat following !