Mostly trivial whitespace cleanups.

Clang-format and removing whitespace at the ends of lines.

Signed-off-by: Dan Cross <patchdev@fat-dragon.org>
This commit is contained in:
Dan Cross 2018-10-16 15:21:42 +00:00 committed by Andrew Pamment
parent 359a190ee9
commit 32d1c70622
8 changed files with 193 additions and 194 deletions

View File

@ -646,15 +646,15 @@ int bwave_add_message(int confr, int area, unsigned int dwritten, char *to, char
if (mc->nettype == NETWORK_FIDO) { if (mc->nettype == NETWORK_FIDO) {
if (mc->fidoaddr->point) { if (mc->fidoaddr->point) {
snprintf(buffer, sizeof buffer, "%d:%d/%d.%d", snprintf(buffer, sizeof buffer, "%d:%d/%d.%d",
mc->fidoaddr->zone, mc->fidoaddr->zone,
mc->fidoaddr->net, mc->fidoaddr->net,
mc->fidoaddr->node, mc->fidoaddr->node,
mc->fidoaddr->point); mc->fidoaddr->point);
} else { } else {
snprintf(buffer, sizeof buffer, "%d:%d/%d", snprintf(buffer, sizeof buffer, "%d:%d/%d",
mc->fidoaddr->zone, mc->fidoaddr->zone,
mc->fidoaddr->net, mc->fidoaddr->net,
mc->fidoaddr->node); mc->fidoaddr->node);
} }
jsf.LoID = JAMSFLD_OADDRESS; jsf.LoID = JAMSFLD_OADDRESS;
jsf.HiID = 0; jsf.HiID = 0;
@ -663,11 +663,11 @@ int bwave_add_message(int confr, int area, unsigned int dwritten, char *to, char
JAM_PutSubfield(jsp, &jsf); JAM_PutSubfield(jsp, &jsf);
snprintf(buffer, sizeof buffer, "%d:%d/%d.%d %08lx", snprintf(buffer, sizeof buffer, "%d:%d/%d.%d %08lx",
mc->fidoaddr->zone, mc->fidoaddr->zone,
mc->fidoaddr->net, mc->fidoaddr->net,
mc->fidoaddr->node, mc->fidoaddr->node,
mc->fidoaddr->point, mc->fidoaddr->point,
generate_msgid()); generate_msgid());
jsf.LoID = JAMSFLD_MSGID; jsf.LoID = JAMSFLD_MSGID;
jsf.HiID = 0; jsf.HiID = 0;
@ -705,15 +705,15 @@ int bwave_add_message(int confr, int area, unsigned int dwritten, char *to, char
if (mc->fidoaddr->point) { if (mc->fidoaddr->point) {
snprintf(buffer, sizeof buffer, "%d:%d/%d.%d", snprintf(buffer, sizeof buffer, "%d:%d/%d.%d",
mc->fidoaddr->zone, mc->fidoaddr->zone,
mc->fidoaddr->net, mc->fidoaddr->net,
mc->fidoaddr->node, mc->fidoaddr->node,
mc->fidoaddr->point); mc->fidoaddr->point);
} else { } else {
snprintf(buffer, sizeof buffer, "%d:%d/%d", snprintf(buffer, sizeof buffer, "%d:%d/%d",
mc->fidoaddr->zone, mc->fidoaddr->zone,
mc->fidoaddr->net, mc->fidoaddr->net,
mc->fidoaddr->node); mc->fidoaddr->node);
} }
jsf.LoID = JAMSFLD_OADDRESS; jsf.LoID = JAMSFLD_OADDRESS;
jsf.HiID = 0; jsf.HiID = 0;
@ -724,15 +724,15 @@ int bwave_add_message(int confr, int area, unsigned int dwritten, char *to, char
if (destaddr != NULL) { if (destaddr != NULL) {
if (destaddr->point) { if (destaddr->point) {
snprintf(buffer, sizeof buffer, "%d:%d/%d.%d", snprintf(buffer, sizeof buffer, "%d:%d/%d.%d",
destaddr->zone, destaddr->zone,
destaddr->net, destaddr->net,
destaddr->node, destaddr->node,
destaddr->point); destaddr->point);
} else { } else {
snprintf(buffer, sizeof buffer, "%d:%d/%d", snprintf(buffer, sizeof buffer, "%d:%d/%d",
destaddr->zone, destaddr->zone,
destaddr->net, destaddr->net,
destaddr->node); destaddr->node);
} }
jsf.LoID = JAMSFLD_DADDRESS; jsf.LoID = JAMSFLD_DADDRESS;
jsf.HiID = 0; jsf.HiID = 0;
@ -742,11 +742,11 @@ int bwave_add_message(int confr, int area, unsigned int dwritten, char *to, char
} }
snprintf(buffer, sizeof buffer, "%d:%d/%d.%d %08lx", snprintf(buffer, sizeof buffer, "%d:%d/%d.%d %08lx",
mc->fidoaddr->zone, mc->fidoaddr->zone,
mc->fidoaddr->net, mc->fidoaddr->net,
mc->fidoaddr->node, mc->fidoaddr->node,
mc->fidoaddr->point, mc->fidoaddr->point,
generate_msgid()); generate_msgid());
jsf.LoID = JAMSFLD_MSGID; jsf.LoID = JAMSFLD_MSGID;
jsf.HiID = 0; jsf.HiID = 0;

View File

@ -72,15 +72,15 @@ static struct file_sub *user_sub(struct user_record *user) {
} }
static void open_sub_db_or_die(sqlite3 **db, char *sub) { static void open_sub_db_or_die(sqlite3 **db, char *sub) {
char buffer[PATH_MAX]; char buffer[PATH_MAX];
snprintf(buffer, PATH_MAX, "%s/%s.sq3", conf.bbs_path, sub); snprintf(buffer, PATH_MAX, "%s/%s.sq3", conf.bbs_path, sub);
if (sqlite3_open(buffer, db) != SQLITE_OK) { if (sqlite3_open(buffer, db) != SQLITE_OK) {
dolog("Cannot open database: %s", sqlite3_errmsg(*db)); dolog("Cannot open database: %s", sqlite3_errmsg(*db));
sqlite3_close(*db); sqlite3_close(*db);
exit(1); exit(1);
} }
assert(db != NULL); assert(db != NULL);
sqlite3_busy_timeout(*db, 5000); sqlite3_busy_timeout(*db, 5000);
} }
struct tagged_file **tagged_files; struct tagged_file **tagged_files;
@ -368,7 +368,7 @@ char *get_file_id_diz(char *filename) {
} }
snprintf(buffer, sizeof buffer, "%s/node%d/temp", conf.bbs_path, mynode); snprintf(buffer, sizeof buffer, "%s/node%d/temp", conf.bbs_path, mynode);
if (access(buffer, F_OK|W_OK) == 0) { if (access(buffer, F_OK | W_OK) == 0) {
if (recursive_delete(buffer) != 0) { if (recursive_delete(buffer) != 0) {
return NULL; return NULL;
} }
@ -677,7 +677,7 @@ int do_upload(struct user_record *user, char *final_path) {
if (defproto->upload_prompt) { if (defproto->upload_prompt) {
snprintf(upload_command, 1024, "%s%s", upload_path, buffer3); snprintf(upload_command, 1024, "%s%s", upload_path, buffer3);
if (access(upload_command, W_OK|X_OK) != 0) { if (access(upload_command, W_OK | X_OK) != 0) {
recursive_delete(upload_path); recursive_delete(upload_path);
return 0; return 0;
} }

View File

@ -469,13 +469,13 @@ int l_postMessage(lua_State *L) {
if (mc->fidoaddr->point) { if (mc->fidoaddr->point) {
snprintf(buffer, sizeof buffer, "%d:%d/%d.%d", snprintf(buffer, sizeof buffer, "%d:%d/%d.%d",
mc->fidoaddr->zone, mc->fidoaddr->zone,
mc->fidoaddr->net, mc->fidoaddr->net,
mc->fidoaddr->node, mc->fidoaddr->node,
mc->fidoaddr->point); mc->fidoaddr->point);
} else { } else {
snprintf(buffer, sizeof buffer, "%d:%d/%d", snprintf(buffer, sizeof buffer, "%d:%d/%d",
mc->fidoaddr->zone, mc->fidoaddr->zone,
mc->fidoaddr->net, mc->fidoaddr->net,
mc->fidoaddr->node); mc->fidoaddr->node);
} }
@ -486,7 +486,7 @@ int l_postMessage(lua_State *L) {
JAM_PutSubfield(jsp, &jsf); JAM_PutSubfield(jsp, &jsf);
snprintf(buffer, sizeof buffer, "%d:%d/%d.%d %08lx", snprintf(buffer, sizeof buffer, "%d:%d/%d.%d %08lx",
mc->fidoaddr->zone, mc->fidoaddr->zone,
mc->fidoaddr->net, mc->fidoaddr->net,
mc->fidoaddr->node, mc->fidoaddr->node,
mc->fidoaddr->point, mc->fidoaddr->point,
@ -528,12 +528,12 @@ int l_postMessage(lua_State *L) {
if (mc->nettype == NETWORK_FIDO) { if (mc->nettype == NETWORK_FIDO) {
if (mc->fidoaddr->point == 0) { if (mc->fidoaddr->point == 0) {
snprintf(buffer, sizeof buffer, "\r--- MagickaBBS v%d.%d%s (%s/%s)\r * Origin: %s (%d:%d/%d)\r", snprintf(buffer, sizeof buffer, "\r--- MagickaBBS v%d.%d%s (%s/%s)\r * Origin: %s (%d:%d/%d)\r",
VERSION_MAJOR, VERSION_MINOR, VERSION_STR, name.sysname, name.machine, tagline, VERSION_MAJOR, VERSION_MINOR, VERSION_STR, name.sysname, name.machine, tagline,
mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node); mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node);
} else { } else {
snprintf(buffer, sizeof buffer, "\r--- MagickaBBS v%d.%d%s (%s/%s)\r * Origin: %s (%d:%d/%d.%d)\r", snprintf(buffer, sizeof buffer, "\r--- MagickaBBS v%d.%d%s (%s/%s)\r * Origin: %s (%d:%d/%d.%d)\r",
VERSION_MAJOR, VERSION_MINOR, VERSION_STR, name.sysname, name.machine, tagline, VERSION_MAJOR, VERSION_MINOR, VERSION_STR, name.sysname, name.machine, tagline,
mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node, mc->fidoaddr->point); mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node, mc->fidoaddr->point);
} }
} else { } else {
snprintf(buffer, sizeof buffer, "\r--- MagickaBBS v%d.%d%s (%s/%s)\r * Origin: %s \r", snprintf(buffer, sizeof buffer, "\r--- MagickaBBS v%d.%d%s (%s/%s)\r * Origin: %s \r",

View File

@ -457,21 +457,21 @@ char *external_editor(struct user_record *user, char *to, char *from, char *quot
if (mc->nettype == NETWORK_FIDO && !email) { if (mc->nettype == NETWORK_FIDO && !email) {
if (mc->fidoaddr->point == 0) { if (mc->fidoaddr->point == 0) {
snprintf(buffer, sizeof buffer, "\r--- MagickaBBS v%d.%d%s (%s/%s)\r * Origin: %s (%d:%d/%d)\r", snprintf(buffer, sizeof buffer, "\r--- MagickaBBS v%d.%d%s (%s/%s)\r * Origin: %s (%d:%d/%d)\r",
VERSION_MAJOR, VERSION_MINOR, VERSION_STR, name.sysname, name.machine, tagline, VERSION_MAJOR, VERSION_MINOR, VERSION_STR, name.sysname, name.machine, tagline,
mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node); mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node);
} else { } else {
snprintf(buffer, sizeof buffer, "\r--- MagickaBBS v%d.%d%s (%s/%s)\r * Origin: %s (%d:%d/%d.%d)\r", snprintf(buffer, sizeof buffer, "\r--- MagickaBBS v%d.%d%s (%s/%s)\r * Origin: %s (%d:%d/%d.%d)\r",
VERSION_MAJOR, VERSION_MINOR, VERSION_STR, name.sysname, name.machine, tagline, VERSION_MAJOR, VERSION_MINOR, VERSION_STR, name.sysname, name.machine, tagline,
mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node, mc->fidoaddr->point); mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node, mc->fidoaddr->point);
} }
} else if (mc->nettype == NETWORK_MAGI && !email) { } else if (mc->nettype == NETWORK_MAGI && !email) {
snprintf(buffer, sizeof buffer, "\r--- MagickaBBS v%d.%d%s (%s/%s)\r * Origin: %s (@%d)\r", snprintf(buffer, sizeof buffer, "\r--- MagickaBBS v%d.%d%s (%s/%s)\r * Origin: %s (@%d)\r",
VERSION_MAJOR, VERSION_MINOR, VERSION_STR, name.sysname, name.machine, tagline, VERSION_MAJOR, VERSION_MINOR, VERSION_STR, name.sysname, name.machine, tagline,
mc->maginode); mc->maginode);
} else if (mc->nettype == NETWORK_QWK && !email) { } else if (mc->nettype == NETWORK_QWK && !email) {
snprintf(buffer, sizeof buffer, "\r--- MagickaBBS v%d.%d%s (%s/%s)\r * Origin: %s (%s)\r", snprintf(buffer, sizeof buffer, "\r--- MagickaBBS v%d.%d%s (%s/%s)\r * Origin: %s (%s)\r",
VERSION_MAJOR, VERSION_MINOR, VERSION_STR, name.sysname, name.machine, tagline, VERSION_MAJOR, VERSION_MINOR, VERSION_STR, name.sysname, name.machine, tagline,
conf.bwave_name); conf.bwave_name);
} else { } else {
snprintf(buffer, sizeof buffer, "\r"); snprintf(buffer, sizeof buffer, "\r");
} }
@ -593,25 +593,25 @@ char *editor(struct user_record *user, char *quote, int quotelen, char *from, in
if (mc->nettype == NETWORK_FIDO && !email) { if (mc->nettype == NETWORK_FIDO && !email) {
if (mc->fidoaddr->point == 0) { if (mc->fidoaddr->point == 0) {
snprintf(buffer, sizeof buffer, snprintf(buffer, sizeof buffer,
"\r--- MagickaBBS v%d.%d%s (%s/%s)\r * Origin: %s (%d:%d/%d)\r", "\r--- MagickaBBS v%d.%d%s (%s/%s)\r * Origin: %s (%d:%d/%d)\r",
VERSION_MAJOR, VERSION_MINOR, VERSION_STR, name.sysname, name.machine, tagline, VERSION_MAJOR, VERSION_MINOR, VERSION_STR, name.sysname, name.machine, tagline,
mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node); mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node);
} else { } else {
snprintf(buffer, sizeof buffer, snprintf(buffer, sizeof buffer,
"\r--- MagickaBBS v%d.%d%s (%s/%s)\r * Origin: %s (%d:%d/%d.%d)\r", "\r--- MagickaBBS v%d.%d%s (%s/%s)\r * Origin: %s (%d:%d/%d.%d)\r",
VERSION_MAJOR, VERSION_MINOR, VERSION_STR, name.sysname, name.machine, tagline, VERSION_MAJOR, VERSION_MINOR, VERSION_STR, name.sysname, name.machine, tagline,
mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node, mc->fidoaddr->point); mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node, mc->fidoaddr->point);
} }
} else if (mc->nettype == NETWORK_MAGI && !email) { } else if (mc->nettype == NETWORK_MAGI && !email) {
snprintf(buffer, sizeof buffer, snprintf(buffer, sizeof buffer,
"\r--- MagickaBBS v%d.%d%s (%s/%s)\r * Origin: %s (@%d)\r", "\r--- MagickaBBS v%d.%d%s (%s/%s)\r * Origin: %s (@%d)\r",
VERSION_MAJOR, VERSION_MINOR, VERSION_STR, name.sysname, name.machine, tagline, VERSION_MAJOR, VERSION_MINOR, VERSION_STR, name.sysname, name.machine, tagline,
mc->maginode); mc->maginode);
} else if (mc->nettype == NETWORK_QWK && !email) { } else if (mc->nettype == NETWORK_QWK && !email) {
snprintf(buffer, sizeof buffer, snprintf(buffer, sizeof buffer,
"\r--- MagickaBBS v%d.%d%s (%s/%s)\r * Origin: %s (%s)\r", "\r--- MagickaBBS v%d.%d%s (%s/%s)\r * Origin: %s (%s)\r",
VERSION_MAJOR, VERSION_MINOR, VERSION_STR, name.sysname, name.machine, tagline, VERSION_MAJOR, VERSION_MINOR, VERSION_STR, name.sysname, name.machine, tagline,
conf.bwave_name); conf.bwave_name);
} else { } else {
strlcpy(buffer, "\r", sizeof buffer); strlcpy(buffer, "\r", sizeof buffer);
} }
@ -1457,7 +1457,7 @@ int read_message(struct user_record *user, struct msg_headers *msghs, int mailno
buffer[strlen(buffer) - 1] = '\0'; buffer[strlen(buffer) - 1] = '\0';
s_printf(get_string(109), buffer, mailno + 1, msghs->msg_count); s_printf(get_string(109), buffer, mailno + 1, msghs->msg_count);
s_printf(get_string(110), (msghs->msgs[mailno]->msg_h->Attribute & JAM_MSG_SENT ? "SENT" : ""), s_printf(get_string(110), (msghs->msgs[mailno]->msg_h->Attribute & JAM_MSG_SENT ? "SENT" : ""),
(msgbase_is_flagged(user, user->cur_mail_conf, user->cur_mail_area, msghs->msgs[mailno]->msg_h->MsgNum) ? "FLAGGED" : "")); (msgbase_is_flagged(user, user->cur_mail_conf, user->cur_mail_area, msghs->msgs[mailno]->msg_h->MsgNum) ? "FLAGGED" : ""));
s_printf(get_string(111)); s_printf(get_string(111));
body = (char *)malloz(msghs->msgs[mailno]->msg_h->TxtLen); body = (char *)malloz(msghs->msgs[mailno]->msg_h->TxtLen);
@ -1658,11 +1658,11 @@ int read_message(struct user_record *user, struct msg_headers *msghs, int mailno
if (mc->nettype == NETWORK_FIDO) { if (mc->nettype == NETWORK_FIDO) {
if (mc->fidoaddr->point) { if (mc->fidoaddr->point) {
snprintf(buffer, sizeof buffer, "%d:%d/%d.%d", snprintf(buffer, sizeof buffer, "%d:%d/%d.%d",
mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node, mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node,
mc->fidoaddr->point); mc->fidoaddr->point);
} else { } else {
snprintf(buffer, sizeof buffer, "%d:%d/%d", snprintf(buffer, sizeof buffer, "%d:%d/%d",
mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node); mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node);
} }
jsf.LoID = JAMSFLD_OADDRESS; jsf.LoID = JAMSFLD_OADDRESS;
jsf.HiID = 0; jsf.HiID = 0;
@ -1671,7 +1671,7 @@ int read_message(struct user_record *user, struct msg_headers *msghs, int mailno
JAM_PutSubfield(jsp, &jsf); JAM_PutSubfield(jsp, &jsf);
snprintf(buffer, sizeof buffer, "%d:%d/%d.%d %08lx", snprintf(buffer, sizeof buffer, "%d:%d/%d.%d %08lx",
mc->fidoaddr->zone, mc->fidoaddr->zone,
mc->fidoaddr->net, mc->fidoaddr->net,
mc->fidoaddr->node, mc->fidoaddr->node,
mc->fidoaddr->point, mc->fidoaddr->point,
@ -1732,7 +1732,7 @@ int read_message(struct user_record *user, struct msg_headers *msghs, int mailno
if (mc->nettype == NETWORK_FIDO) { if (mc->nettype == NETWORK_FIDO) {
if (mc->fidoaddr->point) { if (mc->fidoaddr->point) {
snprintf(buffer, sizeof buffer, "%d:%d/%d.%d", snprintf(buffer, sizeof buffer, "%d:%d/%d.%d",
mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node, mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node,
mc->fidoaddr->point); mc->fidoaddr->point);
} else { } else {
snprintf(buffer, sizeof buffer, "%d:%d/%d", snprintf(buffer, sizeof buffer, "%d:%d/%d",
@ -1748,11 +1748,11 @@ int read_message(struct user_record *user, struct msg_headers *msghs, int mailno
if (from_addr != NULL) { if (from_addr != NULL) {
if (from_addr->point) { if (from_addr->point) {
snprintf(buffer, sizeof buffer, "%d:%d/%d.%d", snprintf(buffer, sizeof buffer, "%d:%d/%d.%d",
from_addr->zone, from_addr->net, from_addr->node, from_addr->zone, from_addr->net, from_addr->node,
from_addr->point); from_addr->point);
} else { } else {
snprintf(buffer, sizeof buffer, "%d:%d/%d", snprintf(buffer, sizeof buffer, "%d:%d/%d",
from_addr->zone, from_addr->net, from_addr->node); from_addr->zone, from_addr->net, from_addr->node);
} }
jsf.LoID = JAMSFLD_DADDRESS; jsf.LoID = JAMSFLD_DADDRESS;
jsf.HiID = 0; jsf.HiID = 0;
@ -1763,8 +1763,8 @@ int read_message(struct user_record *user, struct msg_headers *msghs, int mailno
} }
snprintf(buffer, sizeof buffer, "%d:%d/%d.%d %08lx", snprintf(buffer, sizeof buffer, "%d:%d/%d.%d %08lx",
mc->fidoaddr->zone, mc->fidoaddr->zone,
mc->fidoaddr->net, mc->fidoaddr->net,
mc->fidoaddr->node, mc->fidoaddr->node,
mc->fidoaddr->point, mc->fidoaddr->point,
generate_msgid()); generate_msgid());
@ -2123,11 +2123,11 @@ void post_message(struct user_record *user) {
if (mc->nettype == NETWORK_FIDO) { if (mc->nettype == NETWORK_FIDO) {
if (mc->fidoaddr->point) { if (mc->fidoaddr->point) {
snprintf(buffer, sizeof buffer, "%d:%d/%d.%d", snprintf(buffer, sizeof buffer, "%d:%d/%d.%d",
mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node, mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node,
mc->fidoaddr->point); mc->fidoaddr->point);
} else { } else {
snprintf(buffer, sizeof buffer, "%d:%d/%d", snprintf(buffer, sizeof buffer, "%d:%d/%d",
mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node); mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node);
} }
jsf.LoID = JAMSFLD_OADDRESS; jsf.LoID = JAMSFLD_OADDRESS;
jsf.HiID = 0; jsf.HiID = 0;
@ -2136,7 +2136,7 @@ void post_message(struct user_record *user) {
JAM_PutSubfield(jsp, &jsf); JAM_PutSubfield(jsp, &jsf);
snprintf(buffer, sizeof buffer, "%d:%d/%d.%d %08lx", snprintf(buffer, sizeof buffer, "%d:%d/%d.%d %08lx",
mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node, mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node,
mc->fidoaddr->point, generate_msgid()); mc->fidoaddr->point, generate_msgid());
jsf.LoID = JAMSFLD_MSGID; jsf.LoID = JAMSFLD_MSGID;
@ -2176,11 +2176,11 @@ void post_message(struct user_record *user) {
if (mc->nettype == NETWORK_FIDO) { if (mc->nettype == NETWORK_FIDO) {
if (mc->fidoaddr->point) { if (mc->fidoaddr->point) {
snprintf(buffer, sizeof buffer, "%d:%d/%d.%d", snprintf(buffer, sizeof buffer, "%d:%d/%d.%d",
mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node, mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node,
mc->fidoaddr->point); mc->fidoaddr->point);
} else { } else {
snprintf(buffer, sizeof buffer, "%d:%d/%d", snprintf(buffer, sizeof buffer, "%d:%d/%d",
mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node); mc->fidoaddr->zone, mc->fidoaddr->net, mc->fidoaddr->node);
} }
jsf.LoID = JAMSFLD_OADDRESS; jsf.LoID = JAMSFLD_OADDRESS;
jsf.HiID = 0; jsf.HiID = 0;
@ -2191,11 +2191,11 @@ void post_message(struct user_record *user) {
if (from_addr != NULL) { if (from_addr != NULL) {
if (from_addr->point) { if (from_addr->point) {
snprintf(buffer, sizeof buffer, "%d:%d/%d.%d", snprintf(buffer, sizeof buffer, "%d:%d/%d.%d",
from_addr->zone, from_addr->net, from_addr->node, from_addr->zone, from_addr->net, from_addr->node,
from_addr->point); from_addr->point);
} else { } else {
snprintf(buffer, sizeof buffer, "%d:%d/%d", snprintf(buffer, sizeof buffer, "%d:%d/%d",
from_addr->zone, from_addr->net, from_addr->node); from_addr->zone, from_addr->net, from_addr->node);
} }
jsf.LoID = JAMSFLD_DADDRESS; jsf.LoID = JAMSFLD_DADDRESS;
jsf.HiID = 0; jsf.HiID = 0;
@ -2207,7 +2207,7 @@ void post_message(struct user_record *user) {
} }
snprintf(buffer, sizeof buffer, "%d:%d/%d.%d %08lx", snprintf(buffer, sizeof buffer, "%d:%d/%d.%d %08lx",
mc->fidoaddr->zone, mc->fidoaddr->zone,
mc->fidoaddr->net, mc->fidoaddr->net,
mc->fidoaddr->node, mc->fidoaddr->node,
mc->fidoaddr->point, mc->fidoaddr->point,

View File

@ -108,7 +108,7 @@ void display_textfiles() {
s_printf(get_string(144)); s_printf(get_string(144));
for (size_t i = start; i < start + 22 && i < ptr_vector_len(&conf.text_files); i++) { for (size_t i = start; i < start + 22 && i < ptr_vector_len(&conf.text_files); i++) {
struct text_file *file = ptr_vector_get(&conf.text_files, i); struct text_file *file = ptr_vector_get(&conf.text_files, i);
s_printf(get_string(i == selected ? 249 : 250), i - start + 2, i, file->name); s_printf(get_string(i == selected ? 249 : 250), i - start + 2, i, file->name);
} }
s_printf("\e[%d;5H", selected - start + 2); s_printf("\e[%d;5H", selected - start + 2);
redraw = 0; redraw = 0;

View File

@ -83,60 +83,59 @@ struct key_value_map {
}; };
static const struct key_value_map commands[] = { static const struct key_value_map commands[] = {
{ "SUBMENU", MENU_SUBMENU }, {"SUBMENU", MENU_SUBMENU},
{ "LOGOFF", MENU_LOGOFF }, {"LOGOFF", MENU_LOGOFF},
{ "PREVMENU", MENU_PREVMENU }, {"PREVMENU", MENU_PREVMENU},
{ "AUTOMESSAGE", MENU_AUTOMESSAGE }, {"AUTOMESSAGE", MENU_AUTOMESSAGE},
{ "TEXTFILES", MENU_TEXTFILES }, {"TEXTFILES", MENU_TEXTFILES},
{ "CHATSYSTEM", MENU_CHATSYSTEM }, {"CHATSYSTEM", MENU_CHATSYSTEM},
{ "BBSLIST", MENU_BBSLIST }, {"BBSLIST", MENU_BBSLIST},
{ "LISTUSERS", MENU_LISTUSERS }, {"LISTUSERS", MENU_LISTUSERS},
{ "BULLETINS", MENU_BULLETINS }, {"BULLETINS", MENU_BULLETINS},
{ "LAST10CALLERS", MENU_LAST10 }, {"LAST10CALLERS", MENU_LAST10},
{ "SETTINGS", MENU_SETTINGS }, {"SETTINGS", MENU_SETTINGS},
{ "RUNDOOR", MENU_DOOR }, {"RUNDOOR", MENU_DOOR},
{ "MAILSCAN", MENU_MAILSCAN }, {"MAILSCAN", MENU_MAILSCAN},
{ "READMAIL", MENU_READMAIL }, {"READMAIL", MENU_READMAIL},
{ "POSTMESSAGE", MENU_POSTMESSAGE }, {"POSTMESSAGE", MENU_POSTMESSAGE},
{ "CHOOSEMAILCONF", MENU_CHOOSEMAILCONF }, {"CHOOSEMAILCONF", MENU_CHOOSEMAILCONF},
{ "CHOOSEMAILAREA", MENU_CHOOSEMAILAREA }, {"CHOOSEMAILAREA", MENU_CHOOSEMAILAREA},
{ "SENDEMAIL", MENU_SENDEMAIL }, {"SENDEMAIL", MENU_SENDEMAIL},
{ "LISTEMAIL", MENU_LISTEMAIL }, {"LISTEMAIL", MENU_LISTEMAIL},
{ "NEXTMAILCONF", MENU_NEXTMAILCONF }, {"NEXTMAILCONF", MENU_NEXTMAILCONF},
{ "PREVMAILCONF", MENU_PREVMAILCONF }, {"PREVMAILCONF", MENU_PREVMAILCONF},
{ "NEXTMAILAREA", MENU_NEXTMAILAREA }, {"NEXTMAILAREA", MENU_NEXTMAILAREA},
{ "PREVMAILAREA", MENU_PREVMAILAREA }, {"PREVMAILAREA", MENU_PREVMAILAREA},
{ "BLUEWAVEDOWNLOAD", MENU_BLUEWAVEDOWN }, {"BLUEWAVEDOWNLOAD", MENU_BLUEWAVEDOWN},
{ "BLUEWAVEUPLOAD", MENU_BLUEWAVEUP }, {"BLUEWAVEUPLOAD", MENU_BLUEWAVEUP},
{ "CHOOSEFILEDIR", MENU_CHOOSEFILEDIR }, {"CHOOSEFILEDIR", MENU_CHOOSEFILEDIR},
{ "CHOOSEFILESUB", MENU_CHOOSEFILESUB }, {"CHOOSEFILESUB", MENU_CHOOSEFILESUB},
{ "LISTFILES", MENU_LISTFILES }, {"LISTFILES", MENU_LISTFILES},
{ "UPLOAD", MENU_UPLOAD }, {"UPLOAD", MENU_UPLOAD},
{ "DOWNLOAD", MENU_DOWNLOAD }, {"DOWNLOAD", MENU_DOWNLOAD},
{ "CLEARTAGGED", MENU_CLEARTAGGEDFILES }, {"CLEARTAGGED", MENU_CLEARTAGGEDFILES},
{ "NEXTFILEDIR", MENU_NEXTFILEDIR }, {"NEXTFILEDIR", MENU_NEXTFILEDIR},
{ "PREVFILEDIR", MENU_PREVFILEDIR }, {"PREVFILEDIR", MENU_PREVFILEDIR},
{ "NEXTFILESUB", MENU_NEXTFILESUB }, {"NEXTFILESUB", MENU_NEXTFILESUB},
{ "PREVFILESUB", MENU_PREVFILESUB }, {"PREVFILESUB", MENU_PREVFILESUB},
{ "LISTMESSAGES", MENU_LISTMESSAGES }, {"LISTMESSAGES", MENU_LISTMESSAGES},
{ "DOSCRIPT", MENU_DOSCRIPT }, {"DOSCRIPT", MENU_DOSCRIPT},
{ "SENDNODEMSG", MENU_SENDNODEMSG }, {"SENDNODEMSG", MENU_SENDNODEMSG},
{ "SUBUNSUBCONF", MENU_SUBUNSUBCONF }, {"SUBUNSUBCONF", MENU_SUBUNSUBCONF},
{ "RESETMSGPTRS", MENU_RESETPOINTERS }, {"RESETMSGPTRS", MENU_RESETPOINTERS},
{ "RESETALLMSGPTRS", MENU_RESETALLPOINTERS }, {"RESETALLMSGPTRS", MENU_RESETALLPOINTERS},
{ "FILESCAN", MENU_FILESCAN }, {"FILESCAN", MENU_FILESCAN},
{ "FULLMAILSCAN", MENU_FULLMAILSCAN }, {"FULLMAILSCAN", MENU_FULLMAILSCAN},
{ "FILESEARCH", MENU_FILESEARCH }, {"FILESEARCH", MENU_FILESEARCH},
{ "DISPLAYTXTFILE", MENU_DISPTXTFILE }, {"DISPLAYTXTFILE", MENU_DISPTXTFILE},
{ "DISPLAYTXTPAUSE", MENU_DISPTXTFILEPAUSE }, {"DISPLAYTXTPAUSE", MENU_DISPTXTFILEPAUSE},
{ "GENWWWURLS", MENU_GENWWWURLS }, {"GENWWWURLS", MENU_GENWWWURLS},
{ "NLBROWSER", MENU_NLBROWSER }, {"NLBROWSER", MENU_NLBROWSER},
{ "SENDFEEDBACK", MENU_SENDFEEDBACK }, {"SENDFEEDBACK", MENU_SENDFEEDBACK},
{ "BLOGDISPLAY", MENU_BLOGDISPLAY }, {"BLOGDISPLAY", MENU_BLOGDISPLAY},
{ "BLOGWRITE", MENU_BLOGWRITE } {"BLOGWRITE", MENU_BLOGWRITE}};
};
#define ARRAY_SIZE(A) (sizeof(A)/sizeof((A)[0])) #define ARRAY_SIZE(A) (sizeof(A) / sizeof((A)[0]))
int cmd2cmd(const char *cmd) { int cmd2cmd(const char *cmd) {
for (size_t i = 0; i < ARRAY_SIZE(commands); ++i) for (size_t i = 0; i < ARRAY_SIZE(commands); ++i)

View File

@ -103,12 +103,12 @@ int save_user(struct user_record *user) {
int rc = 0; int rc = 0;
const char *update_sql = const char *update_sql =
"UPDATE users SET password=?, salt=?, firstname=?," "UPDATE users SET password=?, salt=?, firstname=?,"
"lastname=?, email=?, location=?, sec_level=?, last_on=?, " "lastname=?, email=?, location=?, sec_level=?, last_on=?, "
"time_left=?, cur_mail_conf=?, cur_mail_area=?, " "time_left=?, cur_mail_conf=?, cur_mail_area=?, "
"cur_file_dir=?, cur_file_sub=?, times_on=?, bwavepktno=?, " "cur_file_dir=?, cur_file_sub=?, times_on=?, bwavepktno=?, "
"archiver=?, protocol=?,nodemsgs=?,codepage=?,exteditor=?," "archiver=?, protocol=?,nodemsgs=?,codepage=?,exteditor=?,"
"bwavestyle=?,signature=?,autosig=? where loginname LIKE ?"; "bwavestyle=?,signature=?,autosig=? where loginname LIKE ?";
open_users_db_or_die(&db); open_users_db_or_die(&db);
@ -163,7 +163,7 @@ int msgbase_flag_unflag(struct user_record *user, int conference, int msgbase, i
int flagunflag = 0; int flagunflag = 0;
static const char *create_sql = static const char *create_sql =
"CREATE TABLE IF NOT EXISTS msg_flags (conference INTEGER, msgbase INTEGER, uid INTEGER, msg INTEGER);"; "CREATE TABLE IF NOT EXISTS msg_flags (conference INTEGER, msgbase INTEGER, uid INTEGER, msg INTEGER);";
flagunflag = msgbase_is_flagged(user, conference, msgbase, msgid); flagunflag = msgbase_is_flagged(user, conference, msgbase, msgid);
@ -181,11 +181,11 @@ int msgbase_flag_unflag(struct user_record *user, int conference, int msgbase, i
} }
if (flagunflag == 1) { if (flagunflag == 1) {
static const char *unflag_buf = static const char *unflag_buf =
"DELETE FROM msg_flags WHERE conference=? AND msgbase=? AND uid=? AND msg=?"; "DELETE FROM msg_flags WHERE conference=? AND msgbase=? AND uid=? AND msg=?";
rc = sqlite3_prepare_v2(db, unflag_buf, -1, &res, 0); rc = sqlite3_prepare_v2(db, unflag_buf, -1, &res, 0);
} else { } else {
static const char *flag_buf = static const char *flag_buf =
"INSERT INTO msg_flags (conference, msgbase, uid, msg) VALUES(?, ?, ?, ?)"; "INSERT INTO msg_flags (conference, msgbase, uid, msg) VALUES(?, ?, ?, ?)";
rc = sqlite3_prepare_v2(db, flag_buf, -1, &res, 0); rc = sqlite3_prepare_v2(db, flag_buf, -1, &res, 0);
} }
@ -208,7 +208,7 @@ int msgbase_is_flagged(struct user_record *user, int conference, int msgbase, in
int rc = 0; int rc = 0;
static const char *sql_buf = static const char *sql_buf =
"SELECT * FROM msg_flags WHERE conference=? AND msgbase=? AND uid=? AND msg=?"; "SELECT * FROM msg_flags WHERE conference=? AND msgbase=? AND uid=? AND msg=?";
open_users_db_or_die(&db); open_users_db_or_die(&db);
@ -238,7 +238,7 @@ int msgbase_sub_unsub(int conference, int msgbase) {
sqlite3_stmt *res = NULL; sqlite3_stmt *res = NULL;
int rc = 0; int rc = 0;
static const char *create_sql = static const char *create_sql =
"CREATE TABLE IF NOT EXISTS msg_subs (conference INTEGER, msgbase INTEGER, uid INTEGER);"; "CREATE TABLE IF NOT EXISTS msg_subs (conference INTEGER, msgbase INTEGER, uid INTEGER);";
char *err_msg = NULL; char *err_msg = NULL;
int subunsub = msgbase_is_subscribed(conference, msgbase); int subunsub = msgbase_is_subscribed(conference, msgbase);
@ -253,11 +253,11 @@ int msgbase_sub_unsub(int conference, int msgbase) {
} }
if (subunsub == 1) { if (subunsub == 1) {
static char *unsub_buf = static char *unsub_buf =
"DELETE FROM msg_subs WHERE conference=? AND msgbase=? AND uid=?"; "DELETE FROM msg_subs WHERE conference=? AND msgbase=? AND uid=?";
rc = sqlite3_prepare_v2(db, unsub_buf, -1, &res, 0); rc = sqlite3_prepare_v2(db, unsub_buf, -1, &res, 0);
} else { } else {
static const char *sub_buf = static const char *sub_buf =
"INSERT INTO msg_subs (conference, msgbase, uid) VALUES(?, ?, ?)"; "INSERT INTO msg_subs (conference, msgbase, uid) VALUES(?, ?, ?)";
rc = sqlite3_prepare_v2(db, sub_buf, -1, &res, 0); rc = sqlite3_prepare_v2(db, sub_buf, -1, &res, 0);
} }
@ -279,7 +279,7 @@ int msgbase_is_subscribed(int conference, int msgbase) {
int rc = 0; int rc = 0;
static const char *sql_buf = static const char *sql_buf =
"SELECT * FROM msg_subs WHERE conference=? AND msgbase=? AND uid=?"; "SELECT * FROM msg_subs WHERE conference=? AND msgbase=? AND uid=?";
open_users_db_or_die(&db); open_users_db_or_die(&db);
@ -311,40 +311,40 @@ int inst_user(struct user_record *user) {
int rc = 0; int rc = 0;
static const char *create_sql = static const char *create_sql =
"CREATE TABLE IF NOT EXISTS users (" "CREATE TABLE IF NOT EXISTS users ("
"Id INTEGER PRIMARY KEY," "Id INTEGER PRIMARY KEY,"
"loginname TEXT COLLATE NOCASE," "loginname TEXT COLLATE NOCASE,"
"password TEXT," "password TEXT,"
"salt TEXT," "salt TEXT,"
"firstname TEXT," "firstname TEXT,"
"lastname TEXT," "lastname TEXT,"
"email TEXT," "email TEXT,"
"location TEXT," "location TEXT,"
"sec_level INTEGER," "sec_level INTEGER,"
"last_on INTEGER," "last_on INTEGER,"
"time_left INTEGER," "time_left INTEGER,"
"cur_mail_conf INTEGER," "cur_mail_conf INTEGER,"
"cur_mail_area INTEGER," "cur_mail_area INTEGER,"
"cur_file_sub INTEGER," "cur_file_sub INTEGER,"
"cur_file_dir INTEGER," "cur_file_dir INTEGER,"
"times_on INTEGER," "times_on INTEGER,"
"bwavepktno INTEGER," "bwavepktno INTEGER,"
"archiver INTEGER," "archiver INTEGER,"
"protocol INTEGER," "protocol INTEGER,"
"nodemsgs INTEGER," "nodemsgs INTEGER,"
"codepage INTEGER," "codepage INTEGER,"
"exteditor INTEGER," "exteditor INTEGER,"
"bwavestyle INTEGER," "bwavestyle INTEGER,"
"signature TEXT," "signature TEXT,"
"autosig INTEGER);"; "autosig INTEGER);";
static const char *insert_sql = static const char *insert_sql =
"INSERT INTO users (loginname, password, salt, firstname," "INSERT INTO users (loginname, password, salt, firstname,"
"lastname, email, location, sec_level, last_on, time_left, " "lastname, email, location, sec_level, last_on, time_left, "
"cur_mail_conf, cur_mail_area, cur_file_dir, cur_file_sub, " "cur_mail_conf, cur_mail_area, cur_file_dir, cur_file_sub, "
"times_on, bwavepktno, archiver, protocol, nodemsgs, " "times_on, bwavepktno, archiver, protocol, nodemsgs, "
"codepage, exteditor, bwavestyle, signature, autosig) " "codepage, exteditor, bwavestyle, signature, autosig) "
"VALUES(?,?, ?,?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; "VALUES(?,?, ?,?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
open_users_db_or_die(&db); open_users_db_or_die(&db);
@ -410,12 +410,12 @@ struct user_record *check_user_pass(char *loginname, char *password) {
char pathbuf[PATH_MAX]; char pathbuf[PATH_MAX];
static const char *sql = static const char *sql =
"SELECT Id, loginname, password, salt, firstname," "SELECT Id, loginname, password, salt, firstname,"
"lastname, email, location, sec_level, last_on, time_left, " "lastname, email, location, sec_level, last_on, time_left, "
"cur_mail_conf, cur_mail_area, cur_file_dir, cur_file_sub, " "cur_mail_conf, cur_mail_area, cur_file_dir, cur_file_sub, "
"times_on, bwavepktno, archiver, protocol,nodemsgs, " "times_on, bwavepktno, archiver, protocol,nodemsgs, "
"codepage, exteditor, bwavestyle, signature, autosig " "codepage, exteditor, bwavestyle, signature, autosig "
"FROM users WHERE loginname LIKE ?"; "FROM users WHERE loginname LIKE ?";
open_users_db_or_die(&db); open_users_db_or_die(&db);
rc = sqlite3_prepare_v2(db, sql, -1, &res, 0); rc = sqlite3_prepare_v2(db, sql, -1, &res, 0);
@ -546,7 +546,7 @@ int check_fullname(char *firstname, char *lastname) {
int rc = 0; int rc = 0;
static const char *sql = static const char *sql =
"SELECT * FROM users WHERE firstname = ? AND lastname = ?"; "SELECT * FROM users WHERE firstname = ? AND lastname = ?";
open_users_db_or_die(&db); open_users_db_or_die(&db);
rc = sqlite3_prepare_v2(db, sql, -1, &res, 0); rc = sqlite3_prepare_v2(db, sql, -1, &res, 0);

View File

@ -273,7 +273,7 @@ char *www_create_link(int dir, int sub, int fid) {
hashid = (char *)malloz(sizereq + 1); hashid = (char *)malloz(sizereq + 1);
if (hashids_encode_v(hashids, hashid, 4, (unsigned long long)gUser->id, if (hashids_encode_v(hashids, hashid, 4, (unsigned long long)gUser->id,
(unsigned long long)dir, (unsigned long long)sub, (unsigned long long)fid) == 0) { (unsigned long long)dir, (unsigned long long)sub, (unsigned long long)fid) == 0) {
hashids_free(hashids); hashids_free(hashids);
free(hashid); free(hashid);
return NULL; return NULL;