Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit c72a9bc6 authored by rswindell's avatar rswindell

Address warnings reported by Visual Studio 2017 - Windows XP (v141_xp) toolset

parent a46e8164
......@@ -55,9 +55,9 @@
char *ultoac(ulong l, char *string)
{
char str[256];
signed char i,j,k;
size_t i,j,k;
sprintf(str,"%lu",l);
SAFEPRINTF(str,"%lu",l);
i=strlen(str)-1;
j=i/3+1+i;
string[j--]=0;
......
......@@ -288,7 +288,7 @@ int main(int argc, char **argv)
if(cfg.dir[i]->maxage && cfg.dir[i]->misc&DIR_SINCEDL && workfile.datedled
&& (now-workfile.datedled)/86400L>cfg.dir[i]->maxage) {
printf("Deleting %s (%ld days since last download)\n",fname
,(now-workfile.datedled)/86400L);
,(long)(now-workfile.datedled)/86400L);
getfiledat(&cfg, &workfile);
if(!(misc&REPORT)) {
removefiledat(&cfg, &workfile);
......@@ -300,7 +300,7 @@ int main(int argc, char **argv)
&& !(workfile.datedled && cfg.dir[i]->misc&DIR_SINCEDL)
&& (now-workfile.dateuled)/86400L>cfg.dir[i]->maxage) {
printf("Deleting %s (uploaded %ld days ago)\n",fname
,(now-workfile.dateuled)/86400L);
,(long)(now-workfile.dateuled)/86400L);
getfiledat(&cfg, &workfile);
if(!(misc&REPORT)) {
removefiledat(&cfg, &workfile);
......
......@@ -50,10 +50,11 @@ int extdesclines(char *str);
/*****************************************************************************/
int sbbs_t::listfiles(uint dirnum, const char *filespec, int tofile, long mode)
{
char str[256],hdr[256],c,d,letter='A',*p,*datbuf,ext[513];
char str[256],hdr[256],letter='A',*p,*datbuf,ext[513];
char tmp[512];
uchar* ixbbuf;
uchar flagprompt=0;
int c, d;
uint i,j;
int file,found=0,lastbat=0,disp;
long m=0,n,anchor=0,next,datbuflen;
......@@ -669,7 +670,8 @@ bool sbbs_t::movefile(file_t* f, int newdir)
int sbbs_t::batchflagprompt(uint dirnum, file_t* bf, uint total
,long totalfiles)
{
char ch,c,d,str[256],fname[128],*p,remcdt=0,remfile=0;
char ch,str[256],fname[128],*p,remcdt=0,remfile=0;
int c, d;
char tmp[512];
uint i,j,ml=0,md=0,udir,ulib;
file_t f;
......
......@@ -877,7 +877,7 @@ long aftol(char *str)
/*****************************************************************************/
char *ltoaf(long l,char *str)
{
size_t c=0;
int c=0;
while(c<26) {
if(l&(long)(1L<<c))
......
......@@ -694,7 +694,8 @@ bool sbbs_t::inputnstime(time_t *dt)
/*****************************************************************************/
bool sbbs_t::chkpass(char *passwd, user_t* user, bool unique)
{
char c,d,first[128],last[128],sysop[41],sysname[41],*p;
char first[128],last[128],sysop[41],sysname[41],*p;
int c, d;
char alias[LEN_ALIAS+1], name[LEN_NAME+1], handle[LEN_HANDLE+1];
char pass[LEN_PASS+1];
......
......@@ -340,7 +340,7 @@ bool sbbs_t::upload(uint dirnum)
p=strchr(str+i,',');
if(p!=NULL)
*p=0;
ch=strlen(str+i);
ch=(char)strlen(str+i);
if(!stricmp(tmp+9,str+i))
break;
}
......
......@@ -1072,7 +1072,7 @@ void sbbs_t::maindflts(user_t* user)
if(!noyes(text[NewPasswordQ])) {
bputs(text[CurrentPassword]);
console|=CON_R_ECHOX;
ch=getstr(str,LEN_PASS,K_UPPER);
ch=(char)getstr(str,LEN_PASS,K_UPPER);
if(sys_status&SS_ABORT)
break;
console&=~(CON_R_ECHOX|CON_L_ECHOX);
......
......@@ -3853,7 +3853,7 @@ static BOOL fastcgi_add_param(struct fastcgi_message **msg, size_t *end, size_t
*end += 4;
}
else {
(*msg)->body[(*end)++] = namelen;
(*msg)->body[(*end)++] = (char)namelen;
}
if (vallen > 127) {
l = htonl(vallen | 0x80000000);
......@@ -3861,7 +3861,7 @@ static BOOL fastcgi_add_param(struct fastcgi_message **msg, size_t *end, size_t
*end += 4;
}
else {
(*msg)->body[(*end)++] = vallen;
(*msg)->body[(*end)++] = (char)vallen;
}
memcpy((*msg)->body + *end, env, namelen);
*end += namelen;
......@@ -3889,7 +3889,7 @@ static BOOL fastcgi_send_params(SOCKET sock, http_session_t *session)
return FALSE;
}
if (end > 32000) {
msg->head.len = htons(end);
msg->head.len = htons((uint16_t)end);
if (sendsocket(sock, (void *)msg, sizeof(struct fastcgi_header) + end) != (sizeof(struct fastcgi_header) + end)) {
lprintf(LOG_ERR, "%04d ERROR sending FastCGI params", session->socket);
free(msg);
......@@ -3901,7 +3901,7 @@ static BOOL fastcgi_send_params(SOCKET sock, http_session_t *session)
}
strListFree(&env);
if (end) {
msg->head.len = htons(end);
msg->head.len = htons((uint16_t)end);
if (sendsocket(sock, (void *)msg, sizeof(struct fastcgi_header) + end) != (sizeof(struct fastcgi_header) + end)) {
lprintf(LOG_ERR, "%04d ERROR sending FastCGI params", session->socket);
free(msg);
......@@ -3909,7 +3909,7 @@ static BOOL fastcgi_send_params(SOCKET sock, http_session_t *session)
}
end = 0;
}
msg->head.len = htons(end);
msg->head.len = htons((uint16_t)end);
if (sendsocket(sock, (void *)msg, sizeof(struct fastcgi_header) + end) != (sizeof(struct fastcgi_header) + end)) {
lprintf(LOG_ERR, "%04d ERROR sending FastCGI params", session->socket);
free(msg);
......@@ -4111,7 +4111,7 @@ static int fastcgi_write_in(void *arg, char *buf, size_t bufsz)
chunk_size = bufsz - pos;
if (chunk_size > UINT16_MAX)
chunk_size = UINT16_MAX;
head.len = htons(chunk_size);
head.len = htons((uint16_t)chunk_size);
if (sendsocket(cd->sock, (void *)&head, sizeof(head)) != sizeof(head))
return -1;
if (sendsocket(cd->sock, buf+pos, chunk_size) != chunk_size)
......
......@@ -787,7 +787,7 @@ void sbbs_t::editor_inf(int xeditnum, const char *to, const char* from, const ch
void sbbs_t::removeline(char *str, char *str2, char num, char skip)
{
char* buf;
char slen;
size_t slen;
int i,file;
long l=0,flen;
FILE *stream;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment