X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/blobdiff_plain/4b8483ae278577a3adc8d84da81d77019704466f..42dbc6b5efa87e868116549c5932ab62cf716568:/getcgi.c?ds=inline diff --git a/getcgi.c b/getcgi.c index 47a94b2..26c3c50 100644 --- a/getcgi.c +++ b/getcgi.c @@ -25,7 +25,7 @@ char *txt2html(const char *string) char *ptr = NULL; char *nextptr = NULL; - buf[0] = 0; + memset(buf, 0, 1024); ptr = strchr(string, '<'); if (ptr != NULL) { @@ -57,8 +57,42 @@ char *txt2html(const char *string) return buf; } +/* + * start_html - Start HTML output. + * @title: The title for the HTML. + * + * Takes a title string and starts HTML output, including the + * Content-Type header all the way up to
. + */ +void start_html(const char *title) +{ + puts("Content-Type: text/html; charset=utf8\n"); + puts(""); + puts(""); + puts(""); + printf("