troglobit/uftpd

Incorrect file size when listing files

Opened this issue · 0 comments

Hi
uftpd reports incorrect file size when using Winscp and Filezilla. All files are reported with size: 34.359.738.543 KB.
E.g:

19713> Found directory entry .
19713> Found directory entry ..
19713> Found directory entry a.txt
19713> Compose path from cwd: /test2, arg: /a.txt
19713> Final path to file: /test2/a.txt
19713> LIST modify=20240131093819;perm=rw;size=35184372267979;type=file; a.txt

19713> Found directory entry b.txt
19713> Compose path from cwd: /test2, arg: /b.txt
19713> Final path to file: /test2/b.txt
19713> LIST modify=20240131093821;perm=rw;size=35184372268003;type=file; b.txt

w_filesize

This was not an issue on an earlier version of uftpd, so I changed this line in ftpcmd.c back to the earlier version:

   //snprintf(size, sizeof(size), "size=%" PRIu64, st->st_size);
   snprintf(size, sizeof(size), "size=%" PRIu64, (long long unsigned int)st->st_size);

After this change:
c_filesize

I am using a 32bit platform: armv71.

BR
AD