char buf[SIZ];
char thiskey[SIZ];
char *newprefs = NULL;
+ size_t newprefs_len = 0;
- newprefs = malloc(strlen(WC->preferences) + strlen(key) + strlen(value) + 10);
+ newprefs_len = strlen(key) + strlen(value) + 10;
+ if (WC->preferences != NULL) newprefs_len += strlen(WC->preferences);
+ newprefs = malloc(newprefs_len);
if (newprefs == NULL) return;
strcpy(newprefs, "");
int i;
wprintf("<div id=\"banner\">\n");
- wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>");
- wprintf("<img src=\"static/advanpage2_48x.gif\" ALT=\" \" ALIGN=MIDDLE>");
- wprintf("<SPAN CLASS=\"titlebar\"> ");
+ wprintf("<img src=\"static/advanpage2_48x.gif\">");
+ wprintf("<h1>");
wprintf(_("Preferences and settings"));
- wprintf("</SPAN></TD><TD ALIGN=RIGHT>");
+ wprintf("</h1>");
+ wprintf("<ul><li>");
offer_start_page();
- wprintf("</TD></TR></TABLE>\n");
- wprintf("</div>\n"
- "<div id=\"content\">\n");
+ wprintf("</li></ul>\n");
+ wprintf("</div>\n");
+
+ wprintf("<div id=\"content\" class=\"service\">\n");
wprintf("<div class=\"fix_scrollbar_bug\">"
- "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>\n");
+ "<table class=\"preferences_background\"><tr><td>\n");
/** begin form */
wprintf("<center>\n"
"<form name=\"prefform\" action=\"set_preferences\" "
"method=\"post\">\n"
"<table border=0 cellspacing=5 cellpadding=5>\n");
+ wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%ld\">\n", WC->nonce);
/**
* Room list view
wprintf("<tr><td>");
wprintf(_("Default character set for email headers:"));
wprintf("</td><td>");
- wprintf("<input type=\"text\" NAME=\"default_header_charset\" MAXLENGTH=\"32\" VALUE=\"%s\">", buf);
+ wprintf("<input type=\"text\" NAME=\"default_header_charset\" MAXLENGTH=\"32\" VALUE=\"");
+ escputs(buf);
+ wprintf("\">");
wprintf("</td></tr>");
/** submit buttons */
{
char ebuf[300];
- if (strlen(bstr("change_button")) == 0) {
+ if (IsEmptyStr(bstr("change_button"))) {
safestrncpy(WC->ImportantMessage,
_("Cancelled. No settings were changed."),
sizeof WC->ImportantMessage);