From be7b61758953b0e530fe0c87389b273ab9445a44 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Thu, 12 Feb 2009 23:56:20 +0000 Subject: [PATCH] * don't run into unused buffer parts. --- webcit/calendar_view.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/webcit/calendar_view.c b/webcit/calendar_view.c index bd882d066..1c6d098c7 100644 --- a/webcit/calendar_view.c +++ b/webcit/calendar_view.c @@ -146,16 +146,21 @@ void embeddable_mini_calendar(int year, int month, char *urlformat) * ajax embedder for the above mini calendar */ void ajax_mini_calendar(void) { + const StrBuf *Buf; char urlformat[256]; - int i, len; - char *escaped_urlformat; + int i, j, len; + const char *escaped_urlformat; - escaped_urlformat = bstr("urlformat"); - len = strlen(escaped_urlformat) * 2 ; - for (i=0; i sizeof(urlformat)) + len = sizeof(urlformat) / 2; + + for (i=0, j = 0; i < len ; i+=2, j++) { + urlformat[j] = xtoi(&escaped_urlformat[i], 2); } + urlformat[j] = '\0'; embeddable_mini_calendar( ibstr("year"), ibstr("month"), urlformat ); } -- 2.30.2