summaryrefslogtreecommitdiffabout
path: root/html.c
Side-by-side diff
Diffstat (limited to 'html.c') (more/less context) (ignore whitespace changes)
-rw-r--r--html.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/html.c b/html.c
index bf1490f..fab67bd 100644
--- a/html.c
+++ b/html.c
@@ -1,24 +1,32 @@
+/* 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, ...)
{
static char buf[8][1024];
static int bufidx;
int len;
va_list args;
bufidx++;
bufidx &= 7;
va_start(args, format);
len = vsnprintf(buf[bufidx], sizeof(buf[bufidx]), format, args);
va_end(args);
if (len>sizeof(buf[bufidx]))
die("[html.c] string truncated: %s", format);
return buf[bufidx];
}
void html(const char *txt)
{
write(htmlfd, txt, strlen(txt));
}