Skip to content

Commit

Permalink
make if condition shorter
Browse files Browse the repository at this point in the history
  • Loading branch information
VlasovVitaly committed Dec 6, 2013
1 parent 2229e3a commit 67119fb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,7 @@ std::string string_input_win(WINDOW *w, std::string input, int max_length, int s
ret.append(tmp);
}
} else if( ch != 0 && ch != ERR && (ret.size() < max_length || max_length == 0) ) {
if (only_digits && (ch != '0' && ch != '1' && ch != '2' && ch != '3' && ch != '4' && ch != '5'
&& ch != '6' && ch != '7' && ch != '8' && ch != '9')) {
if ( only_digits && !isdigit(ch) ) {
return_key = true;
} else {
if ( pos == ret.size() ) {
Expand Down

0 comments on commit 67119fb

Please sign in to comment.