Small fixes for add file

This commit is contained in:
Michiel Broek 2004-12-22 16:13:12 +00:00
parent c53f54370a
commit dc5e9a2b16
2 changed files with 4 additions and 3 deletions

View File

@ -14,6 +14,7 @@ v0.71.1 28-Nov-2004
Added #define NFGVMIN 1 in openport. Added #define NFGVMIN 1 in openport.
During hangup we set sighup to ignore. During hangup we set sighup to ignore.
Made zmodem-8k downloads work again. Made zmodem-8k downloads work again.
Some small buffer protections added in addfile.
mbnewuser: mbnewuser:
During hangup we set sighup to ignore. During hangup we set sighup to ignore.

View File

@ -851,14 +851,14 @@ int Addfile(char *File, int AreaNum, int fileid)
} }
memset(&fdb, 0, fdbhdr.recsize); memset(&fdb, 0, fdbhdr.recsize);
strcpy(fdb.LName, File); /* LFN, currently real file */ strncpy(fdb.LName, File, 80); /* LFN, currently real file */
strcpy(temp1, File); strcpy(temp1, File);
name_mangle(temp1); name_mangle(temp1);
strcpy(fdb.Name, temp1); /* 8.3 name */ strncpy(fdb.Name, temp1, 12); /* 8.3 name */
fdb.Size = (long)(statfile.st_size); fdb.Size = (long)(statfile.st_size);
fdb.FileDate = statfile.st_mtime; fdb.FileDate = statfile.st_mtime;
fdb.Crc32 = file_crc(Filename, TRUE); fdb.Crc32 = file_crc(Filename, TRUE);
strcpy(fdb.Uploader, exitinfo.sUserName); strncpy(fdb.Uploader, exitinfo.sUserName, 35);
fdb.UploadDate = time(NULL); fdb.UploadDate = time(NULL);
if (strcmp(fdb.Name, fdb.LName)) { if (strcmp(fdb.Name, fdb.LName)) {
/* /*