CID 716865 (#1 of 1): Unchecked return value from library (CHECKED_RETURN)
1. check_return: Calling function "getchar()" without checking return
value. This library function may fail and return an error code.
2. unchecked_value: No check of the return value of "getchar()"
Check really for 'enter' as the user asked for.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
void testradospp_milestone(void)
{
+ int c;
cout << "*** press enter to continue ***" << std::endl;
- getchar();
+ while ((c = getchar()) != EOF) {
+ if (c == '\n')
+ break;
+ }
}
int main(int argc, const char **argv)