* Is the given string NN or NN.NN where ``NN'' is an all-numeric string ? */
| 96 | * Is the given string NN or NN.NN where ``NN'' is an all-numeric string ? |
| 97 | */ |
| 98 | static int |
| 99 | isDISP(const char *disp) |
| 100 | { |
| 101 | size_t w; |
| 102 | int res; |
| 103 | |
| 104 | w = strspn(disp, "0123456789"); |
| 105 | res = 0; |
| 106 | if (w > 0) { |
| 107 | if (disp[w] == '\0') |
| 108 | res = 1; /* NN */ |
| 109 | else if (disp[w] == '.') { |
| 110 | disp += w + 1; |
| 111 | w = strspn(disp, "0123456789"); |
| 112 | if (w > 0 && disp[w] == '\0') |
| 113 | res = 1; /* NN.NN */ |
| 114 | } |
| 115 | } |
| 116 | return (res); |
| 117 | } |