X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/blobdiff_plain/4b8483ae278577a3adc8d84da81d77019704466f..4179d4a97b3a242b14ed023c2c3e8935a6e3e1e4:/getcgi.c 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("