Fix string.h include and sizeof(buf)