I don't see how this has to do with detecting an overflow...to me this is just a matter of making sure you keep an unsigned int >= 0