Use a memstr_max of 0 to indicate that no limit should be applied.