case VIEW_CALENDAR:
case VIEW_CALBRIEF:
wprintf("<li class=\"addevent\"><a href=\"display_enter");
- if (strlen(bstr("year")) > 0) wprintf("?year=%s", bstr("year"));
- if (strlen(bstr("month")) > 0) wprintf("?month=%s", bstr("month"));
- if (strlen(bstr("day")) > 0) wprintf("?day=%s", bstr("day"));
+ if (!IsEmptyStr(bstr("year" ))) wprintf("?year=%s", bstr("year"));
+ if (!IsEmptyStr(bstr("month"))) wprintf("?month=%s", bstr("month"));
+ if (!IsEmptyStr(bstr("day" ))) wprintf("?day=%s", bstr("day"));
wprintf("\">"
"<img align=\"middle\" src=\"static/addevent_24x.gif\" "
"border=\"0\"><span class=\"navbar_link\">"
int floorvalue = 0;
tab = bstr("tab");
- if (strlen(tab) == 0) tab = "admin";
+ if (IsEmptyStr(tab)) tab = "admin";
load_floorlist();
serv_puts("GETR");
wprintf(_("Resides on floor: "));
wprintf("<SELECT NAME=\"er_floor\" SIZE=\"1\">\n");
for (i = 0; i < 128; ++i)
- if (strlen(floorlist[i]) > 0) {
+ if (!IsEmptyStr(floorlist[i])) {
wprintf("<OPTION ");
if (i == er_floor)
wprintf("SELECTED ");
shared_with = realloc(shared_with,
strlen(shared_with) + 32);
strcat(shared_with, node);
- if (strlen(remote_room) > 0) {
+ if (!IsEmptyStr(remote_room)) {
strcat(shared_with, "|");
strcat(shared_with, remote_room);
}
extract_token(buf, shared_with, i, '\n', sizeof buf);
extract_token(node, buf, 0, '|', sizeof node);
extract_token(remote_room, buf, 1, '|', sizeof remote_room);
- if (strlen(node) > 0) {
+ if (!IsEmptyStr(node)) {
wprintf("<FORM METHOD=\"POST\" action=\"netedit\">");
wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%ld\">\n", WC->nonce);
wprintf("<TR><TD>%s</TD>\n", node);
wprintf("<TD>");
- if (strlen(remote_room) > 0) {
+ if (!IsEmptyStr(remote_room)) {
escputs(remote_room);
}
wprintf("</TD>");
wprintf("<INPUT TYPE=\"hidden\" NAME=\"line\" "
"VALUE=\"ignet_push_share|");
urlescputs(node);
- if (strlen(remote_room) > 0) {
+ if (!IsEmptyStr(remote_room)) {
wprintf("|");
urlescputs(remote_room);
}
for (i=0; i<num_tokens(not_shared_with, '\n'); ++i) {
extract_token(node, not_shared_with, i, '\n', sizeof node);
- if (strlen(node) > 0) {
+ if (!IsEmptyStr(node)) {
wprintf("<FORM METHOD=\"POST\" action=\"netedit\">");
wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%ld\">\n", WC->nonce);
wprintf("<TR><TD>");
int bump;
- if (strlen(bstr("ok_button")) == 0) {
+ if (IsEmptyStr(bstr("ok_button"))) {
strcpy(WC->ImportantMessage,
_("Cancelled. Changes were not saved."));
display_editroom();
er_flags2 = extract_int(&buf[4], 7);
strcpy(er_roomaide, bstr("er_roomaide"));
- if (strlen(er_roomaide) == 0) {
+ if (IsEmptyStr(er_roomaide)) {
serv_puts("GETA");
serv_getln(buf, sizeof buf);
if (buf[0] != '2') {
}
strcpy(buf, bstr("er_name"));
buf[128] = 0;
- if (strlen(buf) > 0) {
+ if (!IsEmptyStr(buf)) {
strcpy(er_name, buf);
}
strcpy(buf, bstr("er_password"));
buf[10] = 0;
- if (strlen(buf) > 0)
+ if (!IsEmptyStr(buf))
strcpy(er_password, buf);
strcpy(buf, bstr("er_dirname"));
buf[15] = 0;
- if (strlen(buf) > 0)
+ if (!IsEmptyStr(buf))
strcpy(er_dirname, buf);
strcpy(buf, bstr("type"));
}
gotoroom(er_name);
- if (strlen(er_roomaide) > 0) {
+ if (!IsEmptyStr(er_roomaide)) {
sprintf(buf, "SETA %s", er_roomaide);
serv_puts(buf);
serv_getln(buf, sizeof buf);
strcpy(username, bstr("username"));
- if (strlen(bstr("kick_button")) > 0) {
+ if (!IsEmptyStr(bstr("kick_button"))) {
sprintf(buf, "KICK %s", username);
serv_puts(buf);
serv_getln(buf, sizeof buf);
}
}
- if (strlen(bstr("invite_button")) > 0) {
+ if (!IsEmptyStr(bstr("invite_button"))) {
sprintf(buf, "INVT %s", username);
serv_puts(buf);
serv_getln(buf, sizeof buf);
load_floorlist();
wprintf("<SELECT NAME=\"er_floor\" SIZE=\"1\">\n");
for (i = 0; i < 128; ++i)
- if (strlen(floorlist[i]) > 0) {
+ if (!IsEmptyStr(floorlist[i])) {
wprintf("<OPTION ");
wprintf("VALUE=\"%d\">", i);
escputs(floorlist[i]);
int er_num_type;
int er_view;
- if (strlen(bstr("ok_button")) == 0) {
+ if (IsEmptyStr(bstr("ok_button"))) {
strcpy(WC->ImportantMessage,
_("Cancelled. No new room was created."));
display_main_menu();
char hold_rm[SIZ];
char buf[SIZ];
- if (strlen(bstr("ok_button")) == 0) {
+ if (IsEmptyStr(bstr("ok_button"))) {
display_main_menu();
return;
}
*/
strcpy(final_destination, WC->wc_roomname);
- if (strlen(bstr("ok_button")) > 0) {
+ if (!IsEmptyStr(bstr("ok_button"))) {
serv_printf("GOTO %s", WC->wc_roomname);
serv_getln(buf, sizeof buf);
if (buf[0] == '2') {
char cmpb1[SIZ];
int i, num_addrs;
- if (strlen(bstr("line"))==0) {
+ if (IsEmptyStr(bstr("line"))) {
display_editroom();
return;
}
serv_puts(buf);
}
- if (strlen(bstr("add_button")) > 0) {
+ if (!IsEmptyStr(bstr("add_button"))) {
num_addrs = num_tokens(bstr("line"), ',');
if (num_addrs < 2) {
/* just adding one node or address */
*/
void room_to_folder(char *folder, char *room, int floor, int is_mailbox)
{
- int i;
+ int i, len;
/**
* For mailboxes, just do it straight...
/**
* Replace "\" characters with "|" for pseudo-folder-delimiting
*/
- for (i=0; i<strlen(folder); ++i) {
+ len = strlen (folder);
+ for (i=0; i<len; ++i) {
if (folder[i] == '\\') folder[i] = '|';
}
}
has_subfolders = 0;
if ((i+1) < max_folders) {
- if ( (!strncasecmp(fold[i].name, fold[i+1].name, strlen(fold[i].name)))
- && (fold[i+1].name[strlen(fold[i].name)] == '|') ) {
+ int len;
+ len = strlen(fold[i].name);
+ if ( (!strncasecmp(fold[i].name, fold[i+1].name, len))
+ && (fold[i+1].name[len] == '|') ) {
has_subfolders = 1;
}
}
'|', sizeof floor_name);
if ( (strcasecmp(floor_name, old_floor_name))
- && (strlen(old_floor_name) > 0) ) {
+ && (!IsEmptyStr(old_floor_name)) ) {
/* End inner box */
do_template("endbox");
'|', sizeof floor_name);
if ( (strcasecmp(floor_name, old_floor_name))
- && (strlen(old_floor_name) > 0) ) {
+ && (!IsEmptyStr(old_floor_name)) ) {
/** End inner box */
wprintf("<br>\n");
wprintf("</div>\n"); /** floordiv */
}
wprintf("num_drop_targets = %d;\n", num_drop_targets);
- if (strlen(WC->floordiv_expanded) > 1) {
+ if ((WC->floordiv_expanded[0] != '\0')&&
+ (WC->floordiv_expanded[1] != '\0')){
wprintf("which_div_expanded = '%s';\n", WC->floordiv_expanded);
}
/** Determine whether the user is trying to change views */
if (bstr("view") != NULL) {
- if (strlen(bstr("view")) > 0) {
+ if (!IsEmptyStr(bstr("view"))) {
set_preference("roomlistview", bstr("view"), 1);
}
}
void set_room_policy(void) {
char buf[SIZ];
- if (strlen(bstr("ok_button")) == 0) {
+ if (IsEmptyStr(bstr("ok_button"))) {
strcpy(WC->ImportantMessage,
_("Cancelled. Changes were not saved."));
display_editroom();