Commit f7c6b4b3 authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

A couple more sprintf->SAFEPRINTF conversions

Not sure why, as this utility has been deprecated. :-/
parent 4e3e63ef
Pipeline #2571 passed with stage
in 9 minutes and 19 seconds
......@@ -85,7 +85,7 @@ void updatestats(ulong size)
int file;
uint32_t l;
sprintf(str,"%sdsts.dab",scfg.ctrl_dir);
SAFEPRINTF(str,"%sdsts.dab",scfg.ctrl_dir);
if((file=nopen(str,O_RDWR|O_BINARY))==-1) {
printf("ERR_OPEN %s\n",str);
return;
......@@ -170,7 +170,7 @@ void addlist(char *inpath, uint dirnum, const char* uploader, uint dskip, uint s
dir=opendir(str);
while(dir!=NULL && (dirent=readdir(dir))!=NULL) {
sprintf(filepath, "%s%s"
SAFEPRINTF2(filepath, "%s%s"
,scfg.dir[dirnum]->path
,dirent->d_name);
if(isdir(filepath))
......@@ -264,7 +264,7 @@ void addlist(char *inpath, uint dirnum, const char* uploader, uint dskip, uint s
if((stream=fopen(listpath,"r"))==NULL) {
fprintf(stderr,"Error %d (%s) opening %s\n"
,errno,strerror(errno),listpath);
sprintf(listpath,"%s%s", scfg.dir[dirnum]->path,inpath);
SAFEPRINTF2(listpath, "%s%s", scfg.dir[dirnum]->path, inpath);
fexistcase(listpath);
if((stream=fopen(listpath,"r"))==NULL) {
printf("Can't open: %s\n"
......
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