From: Wilfried Göesgens Date: Sat, 12 Jul 2008 20:20:52 +0000 (+0000) Subject: * fixed several tiny flaws X-Git-Tag: v7.86~2107 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=f6db0c39eb54becde064c6418a74125518892c05 * fixed several tiny flaws --- diff --git a/webcit/groupdav_main.c b/webcit/groupdav_main.c index 651cdb28d..a05c05ad2 100644 --- a/webcit/groupdav_main.c +++ b/webcit/groupdav_main.c @@ -43,7 +43,7 @@ void euid_escapize(char *target, char *source) { target[++target_length] = 0; } else { - sprintf(&target[target_length], "=%02X", source[i]); + sprintf(&target[target_length], "=%02X", (0xFF & source[i])); target_length += 3; } } diff --git a/webcit/messages.c b/webcit/messages.c index 3d20e3b14..288acba14 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -3279,6 +3279,7 @@ void display_enter(void) int is_anonymous = 0; long existing_page = (-1L); size_t dplen; + struct wcsession *WCC = WC; now = time(NULL); @@ -3301,7 +3302,7 @@ void display_enter(void) recipient_required = 1; } else if (buf[0] != '2') { /** Any other error means that we cannot continue */ - sprintf(WC->ImportantMessage, "%s", &buf[4]); + sprintf(WCC->ImportantMessage, "%s", &buf[4]); readloop("readnew"); return; } @@ -3315,8 +3316,8 @@ void display_enter(void) * Are we perhaps in an address book view? If so, then an "enter * message" command really means "add new entry." */ - if (WC->wc_default_view == VIEW_ADDRESSBOOK) { - do_edit_vcard(-1, "", "", WC->wc_roomname); + if (WCC->wc_default_view == VIEW_ADDRESSBOOK) { + do_edit_vcard(-1, "", "", WCC->wc_roomname); return; } @@ -3324,7 +3325,7 @@ void display_enter(void) * Are we perhaps in a calendar room? If so, then an "enter * message" command really means "add new calendar item." */ - if (WC->wc_default_view == VIEW_CALENDAR) { + if (WCC->wc_default_view == VIEW_CALENDAR) { display_edit_event(); return; } @@ -3333,7 +3334,7 @@ void display_enter(void) * Are we perhaps in a tasks view? If so, then an "enter * message" command really means "add new task." */ - if (WC->wc_default_view == VIEW_TASKS) { + if (WCC->wc_default_view == VIEW_TASKS) { display_edit_task(); return; } @@ -3404,13 +3405,13 @@ void display_enter(void) "name=\"enterform\"" ">\n"); wprintf("\n", now); - if (WC->wc_view == VIEW_WIKI) { + if (WCC->wc_view == VIEW_WIKI) { wprintf("\n", bstr("wikipage")); } wprintf("\n", bstr("return_to")); - wprintf("\n", WC->nonce); + wprintf("\n", WCC->nonce); wprintf("wc_roomname); + escputs(WCC->wc_roomname); wprintf("\">\n"); wprintf("room_flags & QR_ANONOPT) { + if (WCC->room_flags & QR_ANONOPT) { wprintf("\n", - ((!strcasecmp(bstr("__ANONYMOUS__"), WC->wc_fullname)) ? "selected" : ""), + ((!strcasecmp(bstr("__ANONYMOUS__"), WCC->wc_fullname)) ? "selected" : ""), _("Anonymous") ); } @@ -3491,7 +3492,7 @@ void display_enter(void) } wprintf(_(" in ")); - escputs(WC->wc_roomname); + escputs(WCC->wc_roomname); wprintf(""); @@ -3600,7 +3601,7 @@ void display_enter(void) } /** If we're editing a wiki page, insert the existing page here... */ - else if (WC->wc_view == VIEW_WIKI) { + else if (WCC->wc_view == VIEW_WIKI) { safestrncpy(buf, bstr("wikipage"), sizeof buf); str_wiki_index(buf); existing_page = locate_message_by_uid(buf); @@ -3610,7 +3611,7 @@ void display_enter(void) } /** Insert our signature if appropriate... */ - if ( (WC->is_mailbox) && yesbstr("sig_inserted") ) { + if ( (WCC->is_mailbox) && !yesbstr("sig_inserted") ) { int UseSig; get_pref_yesno("use_sig", &UseSig, 0); if (UseSig) { @@ -3642,9 +3643,9 @@ void display_enter(void) else if (*sig == '\'') { wprintf("'"); } - else if (isprint(*sig)) { + else /* since we're utf 8, is this a good idea? if (isprint(*sig))*/ { wprintf("%c", *sig); - } + } sig ++; } } @@ -3667,7 +3668,7 @@ void display_enter(void) wprintf(_("Attachments:")); wprintf(" "); wprintf(""); wprintf(_("No signature")); wprintf(" ,  \n"); wprintf(""); wprintf(_("Use this signature:")); wprintf("
" diff --git a/webcit/webcit.h b/webcit/webcit.h index 51171f287..337063f5b 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -705,7 +705,7 @@ void set_PREF_LONG(const char *key, size_t keylen, long value, int save_to_serve #define get_pref_yesno(a, b, c) get_PREF_YESNO(a, sizeof(a) - 1, b, c) int get_PREF_YESNO(const char *key, size_t keylen, int *value, int Default); -#define set_pref_yesno(a, b, c) set_PREF_LONG(a, sizeof(a) - 1, b, c) +#define set_pref_yesno(a, b, c) set_PREF_YESNO(a, sizeof(a) - 1, b, c) void set_PREF_YESNO(const char *key, size_t keylen, int value, int save_to_server);