Commit 3ab210cb authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Fix a few issues around single-file add argument parsing

Triggered by CID 33630: Unbounded source buffer
parent 4d4059e1
......@@ -729,13 +729,13 @@ int main(int argc, char **argv)
SAFECOPY(fdesc, "no description given");
sprintf(str,"%s%s", scfg.dir[dirnum]->path, fname);
SAFEPRINTF2(str,"%s%s", scfg.dir[dirnum]->path, fname);
sprintf(fdesc, "%s ", unixtodstr(&scfg,(time32_t)fdate(str),tmp));
sprintf(fdesc, "%s ", unixtodstr(&scfg,time32(NULL),tmp));
sprintf(tmp, "%.*s", (int)(LEN_FDESC-strlen(fdesc)), argv[++j]);
SAFECOPY(fdesc, tmp);
SAFEPRINTF(fdesc, "%s ", unixtodstr(&scfg,(time32_t)fdate(str),tmp));
else if(mode&TODAYS_DATE)
SAFEPRINTF(fdesc, "%s ", unixtodstr(&scfg,time32(NULL),tmp));
SAFECAT(fdesc, argv[j]);
if(l==-1) {
printf("%s not found.\n",str);
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