Commits (14)
......@@ -262,6 +262,7 @@ int main(int argc, char **argv)
break;
case 'E': /* Exemptions */
flagoff=U_EXEMPT;
// fall-through
case 'R': /* Restrictions */
if(!flagoff)
flagoff=U_REST;
......
......@@ -575,6 +575,7 @@ uchar* arstr(ushort* count, const char* str, scfg_t* cfg, uchar* ar_buf)
case AR_DAY:
if(n>6) /* not past saturday */
n=6;
// fall-through
case AR_AGE: /* byte operands */
case AR_PCR:
case AR_UDR:
......@@ -590,6 +591,7 @@ uchar* arstr(ushort* count, const char* str, scfg_t* cfg, uchar* ar_buf)
case AR_BPS: /* int operands */
if(n<300)
n*=100;
// fall-through
case AR_MAIN_CMDS:
case AR_FILE_CMDS:
case AR_EXPIRE:
......@@ -628,6 +630,7 @@ uchar* arstr(ushort* count, const char* str, scfg_t* cfg, uchar* ar_buf)
case AR_DIRCODE:
case AR_SHELL:
maxlen=LEN_EXTCODE;
// fall-through
case AR_PROT:
case AR_HOST:
case AR_IP:
......
......@@ -703,7 +703,7 @@ bool sbbs_t::addtobatdl(file_t* f)
bprintf(text[FileAddedToBatDlQueue]
,f->name, strListCount(filenames) + 1, cfg.max_batdn, ultoac((ulong)totalcost,tmp)
,ultoac((ulong)totalsize,tmp2)
,sectostr((ulong)totalsize/(ulong)cur_cps,str));
,sectostr((ulong)totalsize/max((ulong)cur_cps, 1),str));
result = true;
}
}
......
......@@ -188,6 +188,7 @@ main(int argc, char **argv)
write(file, &t, 4L);
write(file, &stats, sizeof(stats_t));
close(file);
// fall-through
case 'X':
exit(0);
default:
......
......@@ -658,6 +658,7 @@ int main(int argc, char **argv)
case 0:
printf("NOTICE: The -i option is deprecated, use -if instead\n");
SLEEP(2000);
// fall-through
case 'F':
ciolib_mode=CIOLIB_MODE_CURSES_IBM;
break;
......
......@@ -314,7 +314,7 @@ int sbbs_t::exec_function(csi_t *csi)
}
if(!chksyspass())
return(0);
// fall-through
case CS_FILE_SEND:
csi->logic=sendfile(csi->str) ? LOGIC_TRUE:LOGIC_FALSE;
......@@ -324,7 +324,7 @@ int sbbs_t::exec_function(csi_t *csi)
csi->logic=LOGIC_FALSE;
if(!chksyspass())
return(0);
// fall-through
case CS_FILE_RECEIVE:
csi->logic=recvfile(csi->str) ? LOGIC_TRUE:LOGIC_FALSE;
return(0);
......
......@@ -175,6 +175,7 @@ int main(int argc, char** argv)
switch(tolower(argv[i][1])) {
case 'b':
bodyfp=stdout;
// fall-through
case 'c':
ctrlfp=stdout;
break;
......
......@@ -177,7 +177,7 @@ js_send(JSContext *cx, uintN argc, jsval *arglist)
JS_SET_RVAL(cx, arglist, JSVAL_TRUE);
} else {
p->last_error=COM_ERROR_VALUE;
dbprintf(TRUE, p, "send of %u bytes failed",len);
dbprintf(TRUE, p, "send of %lu bytes failed",len);
}
if(cp)
free(cp);
......
......@@ -64,7 +64,7 @@ static BOOL js_socket_peek_byte(JSContext *cx, js_socket_private_t *p);
static JSBool js_socket_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
static ptrdiff_t js_socket_recv(JSContext *cx, js_socket_private_t *p, void *buf, size_t len, int flags, int timeout);
static JSBool js_socket_resolve(JSContext *cx, JSObject *obj, jsid id);
static int js_socket_sendfilesocket(js_socket_private_t *p, int file, off_t *offset, off_t count);
static off_t js_socket_sendfilesocket(js_socket_private_t *p, int file, off_t *offset, off_t count);
static ptrdiff_t js_socket_sendsocket(js_socket_private_t *p, const void *msg, size_t len, int flush);
static JSBool js_socket_set(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp);
static JSBool js_install_event(JSContext *cx, uintN argc, jsval *arglist, BOOL once);
......@@ -369,13 +369,13 @@ static ptrdiff_t js_socket_sendsocket(js_socket_private_t *p, const void *msg, s
return total;
}
static int js_socket_sendfilesocket(js_socket_private_t *p, int file, off_t *offset, off_t count)
static off_t js_socket_sendfilesocket(js_socket_private_t *p, int file, off_t *offset, off_t count)
{
char buf[1024*16];
off_t len;
int rd;
int wr=0;
int total=0;
off_t total=0;
int i;
if(p->session==-1)
......@@ -1275,7 +1275,7 @@ js_sendfile(JSContext *cx, uintN argc, jsval *arglist)
JSObject *obj=JS_THIS_OBJECT(cx, arglist);
jsval *argv=JS_ARGV(cx, arglist);
char* fname = NULL;
long len;
off_t len;
int file;
js_socket_private_t* p;
jsrefcount rc;
......@@ -1305,7 +1305,7 @@ js_sendfile(JSContext *cx, uintN argc, jsval *arglist)
len = js_socket_sendfilesocket(p, file, NULL, 0);
close(file);
if(len > 0) {
dbprintf(FALSE, p, "sent %u bytes",len);
dbprintf(FALSE, p, "sent %"PRIdOFF" bytes",len);
JS_SET_RVAL(cx, arglist, JSVAL_TRUE);
} else {
p->last_error=ERROR_VALUE;
......
......@@ -1409,6 +1409,7 @@ int main(int argc, char **argv, char** env)
break;
default:
fprintf(stderr,"\n!Unsupported option: %s\n",argv[argn]);
// fall-through
case '?':
usage();
return(do_bail(1));
......
......@@ -5251,21 +5251,6 @@ NO_SSH:
// Count the socket:
call_socket_open_callback(TRUE);
if(client_socket == INVALID_SOCKET) {
#if 0 /* is this necessary still? */
if(ERROR_VALUE == ENOTSOCK || ERROR_VALUE == EINTR || ERROR_VALUE == EINVAL) {
lputs(LOG_NOTICE,"BBS socket closed");
break;
}
#endif
lprintf(LOG_ERR,"!ERROR %d accepting connection", ERROR_VALUE);
#ifdef _WIN32
if(WSAGetLastError()==WSAENOBUFS) { /* recycle (re-init WinSock) on this error */
break;
}
#endif
continue;
}
char host_ip[INET6_ADDRSTRLEN];
inet_addrtop(&client_addr, host_ip, sizeof(host_ip));
......
......@@ -621,6 +621,7 @@ void sbbs_t::readmail(uint usernumber, int which, long lm_mode)
break;
case TERM_KEY_RIGHT:
newline();
// fall-through
case 0:
case '+':
if(smb.curmsg<smb.msgs-1) smb.curmsg++;
......@@ -628,6 +629,7 @@ void sbbs_t::readmail(uint usernumber, int which, long lm_mode)
break;
case TERM_KEY_LEFT:
newline();
// fall-through
case '-':
if(smb.curmsg>0) smb.curmsg--;
break;
......
......@@ -483,7 +483,7 @@ public:
JSRuntime* js_hotkey_runtime;
JSContext* js_hotkey_cx;
JSObject* js_hotkey_glob;
js_callback_t js_callback;
js_callback_t js_callback{};
long js_execfile(const char *fname, const char* startup_dir, JSObject* scope = NULL, JSContext* cx = NULL, JSObject* glob = NULL);
long js_execxtrn(const char *fname, const char* startup_dir);
JSContext* js_init(JSRuntime**, JSObject**, const char* desc);
......@@ -506,8 +506,6 @@ public:
char rlogin_pass[LEN_PASS+1];
char rlogin_term[TELNET_TERM_MAXLEN+1]; /* RLogin passed terminal type/speed (e.g. "xterm/57600") */
uint temp_dirnum;
FILE *nodefile_fp,
*node_ext_fp,
*logfile_fp;
......@@ -537,37 +535,37 @@ public:
ushort node_connection;
char connection[LEN_MODEM+1]; /* Connection Description */
ulong cur_rate; /* Current Connection (DCE) Rate */
ulong cur_cps; /* Current Average Transfer CPS */
ulong dte_rate; /* Current COM Port (DTE) Rate */
time_t timeout; /* User inactivity timeout reference */
ulong timeleft_warn; /* low timeleft warning flag */
ulong cur_rate=0; /* Current Connection (DCE) Rate */
ulong cur_cps=0; /* Current Average Transfer CPS */
ulong dte_rate=0; /* Current COM Port (DTE) Rate */
time_t timeout=0; /* User inactivity timeout reference */
ulong timeleft_warn=0;/* low timeleft warning flag */
uint curatr; /* Current Text Attributes Always */
uint attr_stack[64]; /* Saved attributes (stack) */
int attr_sp; /* Attribute stack pointer */
long lncntr; /* Line Counter - for PAUSE */
bool msghdr_tos; /* Message header was displayed at Top of Screen */
long row; /* Current row */
long rows; /* Current number of Rows for User */
long cols; /* Current number of Columns for User */
long row=0; /* Current row */
long rows=0; /* Current number of Rows for User */
long cols=0; /* Current number of Columns for User */
long column; /* Current column counter (for line counter) */
long tabstop; /* Current symmetric-tabstop (size) */
long lastlinelen; /* The previously displayed line length */
long autoterm; /* Auto-detected terminal type */
long autoterm=0; /* Auto-detected terminal type */
char terminal[TELNET_TERM_MAXLEN+1]; // <- answer() writes to this
long cterm_version; /* (MajorVer*1000) + MinorVer */
long cterm_version=0;/* (MajorVer*1000) + MinorVer */
link_list_t savedlines;
char lbuf[LINE_BUFSIZE+1];/* Temp storage for each line output */
int lbuflen; /* Number of characters in line buffer */
uint latr; /* Starting attribute of line buffer */
uint latr=0; /* Starting attribute of line buffer */
ulong console; /* Defines current Console settings */
char wordwrap[81]; /* Word wrap buffer */
time_t now, /* Used to store current time in Unix format */
time_t now=0, /* Used to store current time in Unix format */
last_sysop_auth,/* Time sysop was last authenticated */
answertime, /* Time call was answered */
logontime, /* Time user logged on */
starttime, /* Time stamp to use for time left calcs */
ns_time, /* File new-scan time */
answertime=0, /* Time call was answered */
logontime=0, /* Time user logged on */
starttime=0, /* Time stamp to use for time left calcs */
ns_time=0, /* File new-scan time */
last_ns_time; /* Most recent new-file-scan this call */
uchar action; /* Current action of user */
long online; /* Remote/Local or not online */
......
......@@ -558,7 +558,7 @@ void status_thread(void *arg)
closesocket(*csock);
free(csock);
pthread_mutex_lock(&status_thread_mutex);
lprintf(LOG_CRIT, "Error recv returned %d (%d)!", len, errno);
lprintf(LOG_CRIT, "Error recv returned %ld (%d)!", len, errno);
continue;
}
// TODO: Check auth... "User\0Pass\0SysPass"
......@@ -624,14 +624,14 @@ void status_thread(void *arg)
if (p-auth >= len) {
closesocket(*csock);
free(csock);
lprintf(LOG_WARNING, "No syspass specified", p);
lprintf(LOG_WARNING, "No syspass specified: '%s'", p);
pthread_mutex_lock(&status_thread_mutex);
continue;
}
if (stricmp(p, scfg.sys_pass)) {
closesocket(*csock);
free(csock);
lprintf(LOG_WARNING, "Invalid syspass %s", p);
lprintf(LOG_WARNING, "Invalid syspass: '%s'", p);
pthread_mutex_lock(&status_thread_mutex);
continue;
}
......
......@@ -1805,6 +1805,7 @@ int main(int argc, char **argv)
break;
default:
fprintf(stderr, "\nUnknown opt '%c'\n", argv[x][j]);
// fall-through
case '?':
printf("%s",usage);
bail(1);
......
......@@ -1964,6 +1964,7 @@ int main(int argc, char** argv) {
case 0:
printf("NOTICE: The -i option is deprecated, use -if instead\n");
SLEEP(2000);
// fall-through
case 'F':
ciolib_mode=CIOLIB_MODE_CURSES_IBM;
break;
......
......@@ -922,6 +922,7 @@ int main(int argc, char** argv) {
case 0:
printf("NOTICE: The -i option is deprecated, use -if instead\n");
SLEEP(2000);
// fall-through
case 'F':
ciolib_mode=CIOLIB_MODE_CURSES_IBM;
break;
......
......@@ -5931,6 +5931,7 @@ static BOOL ssjs_send_headers(http_session_t* session,int chunked)
* the gun at the script writers foot for them */
chunked = false;
session->req.manual_length = TRUE;
// fall-through
default:
safe_snprintf(str,sizeof(str),"%s: %s",p,p2);
strListPush(&session->req.dynamic_heads,str);
......
......@@ -918,8 +918,8 @@ void sbbs_t::xtrndat(const char *name, const char *dropdir, uchar type, ulong tl
write(file,&i,2); /* Size of conference record (if any) */
l=0;
write(file,&l,4); /* Offset of AppRec into USERS.INF (if any) */
i=0;
write(file,&i,1); /* 1, if USERS.SYS file has been updated */
c=0;
write(file,&c,1); /* 1, if USERS.SYS file has been updated */
/* Write fixed record portion */
......