| 223 | } |
| 224 | |
| 225 | static double get_x_coord(const char *args) |
| 226 | { |
| 227 | char *endptr; /* we want it non-null */ |
| 228 | double x_coord = -1; /* -1 is returned if no coordinate is given */ |
| 229 | |
| 230 | if (args == NULL) { |
| 231 | return (-1); /* in case we aren't passed anything */ |
| 232 | } |
| 233 | |
| 234 | while (*args && !apr_isdigit(*args) && *args != ',') { |
| 235 | args++; /* jump to the first digit, but not past |
| 236 | a comma or end */ |
| 237 | } |
| 238 | |
| 239 | x_coord = strtod(args, &endptr); |
| 240 | |
| 241 | if (endptr > args) { /* if a conversion was made */ |
| 242 | return (x_coord); |
| 243 | } |
| 244 | |
| 245 | return (-1); /* else if no conversion was made, |
| 246 | or if no args was given */ |
| 247 | } |
| 248 | |
| 249 | static double get_y_coord(const char *args) |
| 250 | { |
no outgoing calls
no test coverage detected