* returns 1 if s is a non-negative number, with at least one '.' */
| 777 | * returns 1 if s is a non-negative number, with at least one '.' |
| 778 | */ |
| 779 | static int |
| 780 | is_valid_number(const char *s) |
| 781 | { |
| 782 | int i, dots_found = 0; |
| 783 | int len = strlen(s); |
| 784 | |
| 785 | for (i = 0; i<len; ++i) |
| 786 | if (!isdigit(s[i]) && (s[i] !='.' || ++dots_found > 1)) |
| 787 | return 0; |
| 788 | return 1; |
| 789 | } |
| 790 | |
| 791 | /* |
| 792 | * Take as input a string describing a bandwidth value |
no test coverage detected