Consider val being a user input. I expect val to be between 0-65535
Instead of checking if val is not withing acceptable range before denying it, I was wondering if
is this :
uint16_t count = atoi(val);
the same as this :
uint16_t count = (uint16_t)atoi(val);
Is this an acceptable way of "securing" the user input? I do not intend to send a feedback to the user, I just want to make sure it won't explode if someone submits -123 or 999999. It does not matter if count equals 2 because someone submitted 65538