]> gitweb.ps.run Git - ps-cgit/blobdiff - html.c
Don't truncate valid cachefiles
[ps-cgit] / html.c
diff --git a/html.c b/html.c
index 5780dc179e6c22070e0f3a509cafbddfabb89e13..fab67bd0b16b5c43bab558e20c7ecd7764d14711 100644 (file)
--- a/html.c
+++ b/html.c
@@ -1,3 +1,11 @@
+/* html.c: helper functions for html output
+ *
+ * Copyright (C) 2006 Lars Hjemli
+ *
+ * Licensed under GNU General Public License v2
+ *   (see COPYING for full license text)
+ */
+
 #include "cgit.h"
 
 char *fmt(const char *format, ...)
@@ -20,16 +28,18 @@ char *fmt(const char *format, ...)
 
 void html(const char *txt)
 {
-       fputs(txt, stdout);
+       write(htmlfd, txt, strlen(txt));
 }
 
 void htmlf(const char *format, ...)
 {
+       static char buf[65536];
        va_list args;
 
        va_start(args, format);
-       vprintf(format, args);
+       vsnprintf(buf, sizeof(buf), format, args);
        va_end(args);
+       html(buf);
 }
 
 void html_txt(char *txt)