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 format %zu for curl_off_t in ws.c #10439

Closed
mikeduglas opened this issue Feb 7, 2023 · 2 comments
Closed

Incorrect format %zu for curl_off_t in ws.c #10439

mikeduglas opened this issue Feb 7, 2023 · 2 comments
Assignees

Comments

@mikeduglas
Copy link
Contributor

I did this

in ws.c there are several calls of infof() function. For curl_off_t variables %zu format is used which breaks the output. %llu format works well, at least here in Visual Studio 2022, win32 platform.

I expected the following

curl/libcurl version

curl 7.87.1-DEV (i386-pc-win32) libcurl/7.87.1-DEV Schannel WinIDN

operating system

Windows 11
Visual Strudio 2022

@bagder bagder changed the title Incorrect format %zu for curl_off_t Incorrect format %zu for curl_off_t in ws.c Feb 7, 2023
@bagder
Copy link
Member

bagder commented Feb 8, 2023

I believe %Ou is the correct one for our own printf implementation:

curl/lib/mprintf.c

Lines 360 to 366 in 12e9186

case 'O':
#if (SIZEOF_CURL_OFF_T > SIZEOF_LONG)
flags |= FLAGS_LONGLONG;
#else
flags |= FLAGS_LONG;
#endif
break;

@bagder bagder self-assigned this Feb 8, 2023
bagder added a commit that referenced this issue Feb 8, 2023
@mikeduglas
Copy link
Contributor Author

I confirm that %Ou works as expected.

bagder added a commit that referenced this issue Feb 9, 2023
Reported-by: Mike Duglas
Fixes #10439
Closes #10441
bch pushed a commit to bch/curl that referenced this issue Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants