Tweaked the checking of the "limit" in safe_fname().