Commit 1b92da55 authored by rswindell's avatar rswindell
Browse files

More GCC printf-warning fixes <sigh>.

The PRIuOFF versus off_t definition mismatch (in ftpsrvr.c too) has not
yet been resolved (on rPi, gcc 6.3.0).
parent 4d84fd7f
......@@ -422,7 +422,7 @@ size_t read_echostats(const char* fname, echostat_t **echostat)
iniFreeStringList(echoes);
iniFreeStringList(ini);
lprintf(LOG_DEBUG, "Read %lu echo statistics from %s", echo_count, fname);
lprintf(LOG_DEBUG, "Read %lu echo statistics from %s", (ulong)echo_count, fname);
return echo_count;
}
......@@ -455,7 +455,7 @@ void fwrite_echostat_msg(FILE* fp, echostat_msg_t msg, const char* prefix)
if(msg.reply_id[0]) fprintf(fp, "%s.reply_id = %s\n" , prefix, msg.reply_id);
if(msg.pid[0]) fprintf(fp, "%s.pid = %s\n" , prefix, msg.pid);
if(msg.tid[0]) fprintf(fp, "%s.tid = %s\n" , prefix, msg.tid);
fprintf(fp, "%s.length = %lu\n" , prefix, msg.length);
fprintf(fp, "%s.length = %lu\n" , prefix, (ulong)msg.length);
fprintf(fp, "%s.msg_time = %s\n" , prefix, iniTimeStr(msg.msg_time));
if(msg.msg_tz[0]) fprintf(fp, "%s.msg_tz = %s\n" , prefix, msg.msg_tz);
fprintf(fp, "%s.localtime = %s\n" , prefix, iniTimeStr(msg.localtime));
......@@ -1510,7 +1510,7 @@ void netmail_arealist(enum arealist_type type, fidoaddr_t addr, const char* to)
}
}
lprintf(LOG_INFO,"AreaFix (for %s) Created response netmail with %s (%lu areas)"
, smb_faddrtoa(&addr, NULL), title, strListCount(area_list));
, smb_faddrtoa(&addr, NULL), title, (ulong)strListCount(area_list));
strListFree(&area_list);
}
......@@ -1834,10 +1834,10 @@ void alter_areas(str_list_t add_area, str_list_t del_area, fidoaddr_t addr, cons
fclose(afileout);
if(added)
lprintf(LOG_DEBUG, "AreaFix (for %s) Added links to %lu areas in %s"
,smb_faddrtoa(&addr,NULL), added, cfg.areafile);
,smb_faddrtoa(&addr,NULL), (ulong)added, cfg.areafile);
if(deleted)
lprintf(LOG_DEBUG, "AreaFix (for %s) Removed links to %lu areas in %s"
,smb_faddrtoa(&addr,NULL), deleted, cfg.areafile);
,smb_faddrtoa(&addr,NULL), (ulong)deleted, cfg.areafile);
if(added || deleted) {
if(cfg.areafile_backups == 0 || !backup(cfg.areafile, cfg.areafile_backups, /* ren: */TRUE))
delfile(cfg.areafile, __LINE__); /* Delete AREAS.BBS */
......@@ -2950,7 +2950,7 @@ void cleanup(void)
char path[MAX_PATH+1];
if(bad_areas != NULL) {
lprintf(LOG_DEBUG, "Writing %lu areas to %s", strListCount(bad_areas), cfg.badareafile);
lprintf(LOG_DEBUG, "Writing %lu areas to %s", (ulong)strListCount(bad_areas), cfg.badareafile);
FILE* fp = fopen(cfg.badareafile, "wt");
if(fp == NULL) {
lprintf(LOG_ERR, "ERROR %d (%s) opening %s", errno, strerror(errno), cfg.badareafile);
......@@ -5492,7 +5492,7 @@ void find_stray_packets(void)
}
if(fread(&pkthdr,sizeof(pkthdr),1,fp)!=1) {
lprintf(LOG_ERR,"ERROR reading header (%lu bytes) from stray packet: %s"
,sizeof(pkthdr), packet);
,(ulong)sizeof(pkthdr), packet);
fclose(fp);
delfile(packet, __LINE__);
continue;
......@@ -5535,7 +5535,7 @@ void find_stray_packets(void)
}
if(g.gl_pathc)
lprintf(LOG_DEBUG, "%lu stray outbound packets (%lu total pkts) found in %s"
,listCountNodes(&outpkt_list), g.gl_pathc, cfg.temp_dir);
,listCountNodes(&outpkt_list), (ulong)g.gl_pathc, cfg.temp_dir);
globfree(&g);
}
......@@ -5619,7 +5619,7 @@ void import_packets(const char* inbound, nodecfg_t* inbox, bool secure)
if(fread(&pkthdr,sizeof(pkthdr),1,fidomsg)!=1) {
fclose(fidomsg);
lprintf(LOG_ERR,"ERROR line %d reading %lu bytes from %s",__LINE__
,sizeof(pkthdr),packet);
,(ulong)sizeof(pkthdr),packet);
rename_bad_packet(packet);
continue;
}
......
......@@ -2143,7 +2143,7 @@ void DLLCALL services_thread(void* arg)
if((client=malloc(sizeof(service_client_t)))==NULL) {
FREE_AND_NULL(udp_buf);
lprintf(LOG_CRIT,"%04d %s !ERROR allocating %lu bytes of memory for service_client"
,client_socket, service[i].protocol, sizeof(service_client_t));
,client_socket, service[i].protocol, (ulong)sizeof(service_client_t));
close_socket(client_socket);
continue;
}
......
......@@ -1992,7 +1992,7 @@ static named_string_t** read_ini_list(char* path, char* section, char* desc
COUNT_LIST_ITEMS(list,i);
if(i)
lprintf(LOG_DEBUG,"Read %lu %s from %s section of %s"
,i,desc,section==NULL ? "root":section,path);
,(ulong)i,desc,section==NULL ? "root":section,path);
} else
lprintf(LOG_WARNING, "Error %d opening %s", errno, path);
return(list);
......@@ -5964,7 +5964,7 @@ int read_post_data(http_session_t * session)
/* FREE()d in close_request */
p=realloc(session->req.post_data, s);
if(p==NULL) {
lprintf(LOG_CRIT,"%04d !ERROR Allocating %lu bytes of memory",session->socket,session->req.post_len);
lprintf(LOG_CRIT,"%04d !ERROR Allocating %lu bytes of memory",session->socket, (ulong)session->req.post_len);
send_error(session,__LINE__,"413 Request entity too large");
if(fp) fclose(fp);
return(FALSE);
......@@ -6021,14 +6021,14 @@ int read_post_data(http_session_t * session)
if(s < (MAX_POST_LEN+1) && (session->req.post_data=malloc((size_t)(s+1))) != NULL)
session->req.post_len=recvbufsocket(session,session->req.post_data,s);
else {
lprintf(LOG_CRIT,"%04d !ERROR Allocating %lu bytes of memory",session->socket,s);
lprintf(LOG_CRIT,"%04d !ERROR Allocating %lu bytes of memory",session->socket, (ulong)s);
send_error(session,__LINE__,"413 Request entity too large");
return(FALSE);
}
}
}
if(session->req.post_len != s)
lprintf(LOG_DEBUG,"%04d !ERROR Browser said they sent %lu bytes, but I got %lu",session->socket,s,session->req.post_len);
lprintf(LOG_DEBUG,"%04d !ERROR Browser said they sent %lu bytes, but I got %lu",session->socket, (ulong)s, (ulong)session->req.post_len);
if(session->req.post_len > s)
session->req.post_len = s;
session->req.post_data[session->req.post_len]=0;
......@@ -6922,7 +6922,7 @@ void DLLCALL web_server(void* arg)
if(session==NULL) {
/* FREE()d at the start of the session thread */
if((session=malloc(sizeof(http_session_t)))==NULL) {
lprintf(LOG_CRIT,"!ERROR allocating %lu bytes of memory for http_session_t", sizeof(http_session_t));
lprintf(LOG_CRIT,"!ERROR allocating %lu bytes of memory for http_session_t", (ulong)sizeof(http_session_t));
continue;
}
memset(session, 0, sizeof(http_session_t));
......
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