I think you forgot this ^ ?

    If len is always >= 0, make it unsigned.