diff options
author | corvid <corvid@lavabit.com> | 2009-02-20 17:30:22 +0000 |
---|---|---|
committer | corvid <corvid@lavabit.com> | 2009-02-20 17:30:22 +0000 |
commit | 0f36a7204db62f760c71c783148eb1fb97eb7206 (patch) | |
tree | 32ca5465ad844cd3133dfe4593ea61bab67f57d0 /src/form.cc | |
parent | f42d578f6593c34d0f96e1b78d90e8acfb9356c8 (diff) |
required attrs for form.cc
Diffstat (limited to 'src/form.cc')
-rw-r--r-- | src/form.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/form.cc b/src/form.cc index 8c6a277a..e2f01ccc 100644 --- a/src/form.cc +++ b/src/form.cc @@ -314,8 +314,10 @@ void Html_tag_open_form(DilloHtml *html, const char *tag, int tagsize) } if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "action"))) action = a_Html_url_new(html, attrbuf, NULL, 0); - else + else { + BUG_MSG("action attribute required for <form>\n"); action = a_Url_dup(html->base_url); + } content_type = DILLO_HTML_ENC_URLENCODED; if ((method == DILLO_HTML_METHOD_POST) && ((attrbuf = a_Html_get_attr(html, tag, tagsize, "enctype")))) { @@ -628,17 +630,23 @@ void Html_tag_open_textarea(DilloHtml *html, const char *tag, int tagsize) a_Html_stash_init(html); S_TOP(html)->parse_mode = DILLO_HTML_PARSE_MODE_VERBATIM; - cols = 20; - if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "cols"))) + if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "cols"))) { cols = strtol(attrbuf, NULL, 10); + } else { + BUG_MSG("cols attribute is required for <textarea>\n"); + cols = 20; + } if (cols < 1 || cols > MAX_COLS) { int badCols = cols; cols = (cols < 1 ? 20 : MAX_COLS); BUG_MSG("textarea cols=%d, using cols=%d instead\n", badCols, cols); } - rows = 10; - if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "rows"))) + if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "rows"))) { rows = strtol(attrbuf, NULL, 10); + } else { + BUG_MSG("rows attribute is required for <textarea>\n"); + rows = 10; + } if (rows < 1 || rows > MAX_ROWS) { int badRows = rows; rows = (rows < 1 ? 2 : MAX_ROWS); |