Inconsistent snprintf format specification parsing
Bug #242089 reported by
Dmitry Pankratov
This bug report is a duplicate of:
Bug #221979: Inconsistent snprintf format specification parsing.
Edit
Remove
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mingw32-runtime (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: mingw32-runtime
OS: Ubuntu 8.04/AMD64.
Package: 3.13-1
Description:
The snprintf library function incorrectly parses the "%lu" format specifier as "unsigned long long" instead of "unsigned long" resulting in incorrect value formatting.
Example:
#include <stdio.h>
int main() {
char buf[256];
snprintf(buf, 256, "%lu", (size_t)12345678);
printf(buf);
return 0;
}
Prints:
9151369040453460302
Instead of:
12345678
Looks like this problem is fixed in the mingw-runtime 3.14.
To post a comment you must log in.
Can somebody fix it please?? This is quite annoying issue. The patch is attached.