X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/bafab423f20bc1448b293842c235965e1681f07e..4b4a62d507adc61e20e75e2748301ef307a6c95f:/html.c diff --git a/html.c b/html.c index b5c6903..8c45ba6 100644 --- a/html.c +++ b/html.c @@ -6,6 +6,8 @@ * (see COPYING for full license text) */ +#include "cgit.h" +#include "html.h" #include #include #include @@ -63,12 +65,13 @@ char *fmt(const char *format, ...) void html_raw(const char *data, size_t size) { - write(htmlfd, data, size); + if (write(htmlfd, data, size) != size) + fprintf(stderr, "[html.c] html output truncated.\n"); } void html(const char *txt) { - write(htmlfd, txt, strlen(txt)); + html_raw(txt, strlen(txt)); } void htmlf(const char *format, ...) @@ -305,11 +308,7 @@ int http_parse_querystring(const char *txt_, void (*fn)(const char *name, const if (!txt_) return 0; - o = t = txt = strdup(txt_); - if (t == NULL) { - printf("Out of memory\n"); - exit(1); - } + o = t = txt = xstrdup(txt_); while ((c=*t) != '\0') { if (c == '=') { *t = '\0';