* get size, restrict it to reasonable value */
| 411 | * get size, restrict it to reasonable value |
| 412 | */ |
| 413 | static int Html_input_get_size(DilloHtml *html, const char *attrbuf) |
| 414 | { |
| 415 | const int MAX_SIZE = 1024; |
| 416 | int size = 20; |
| 417 | |
| 418 | if (attrbuf) { |
| 419 | size = strtol(attrbuf, NULL, 10); |
| 420 | if (size < 1 || size > MAX_SIZE) { |
| 421 | int badSize = size; |
| 422 | size = (size < 1 ? 20 : MAX_SIZE); |
| 423 | BUG_MSG("<input> size=%d, using size=%d instead.", badSize, size); |
| 424 | } |
| 425 | } |
| 426 | return size; |
| 427 | } |
| 428 | |
| 429 | /** |
| 430 | * Add a new input to current form |
no outgoing calls
no test coverage detected