Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect file size when listing files #42

Open
ArthurDents opened this issue Jan 31, 2024 · 0 comments
Open

Incorrect file size when listing files #42

ArthurDents opened this issue Jan 31, 2024 · 0 comments

Comments

@ArthurDents
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant