You should probably use PATH_MAX instead of CF_BUFSIZE here.