Looks good, if `needed_len` is always greater `0`.