Change %p formatting to match glibc
The %p format is not defined by the standard, that is, it's implementation specific. However, many people are used to what glibc prints: 0x to emphasize that pointers are printed as hex, and a special "(nil)" string when a null pointer is provided, and lower-case letters for hex digits.
This fixes #57 and fixes #84.
Codecov Report
Merging #90 into master will not change coverage. The diff coverage is
100.00%.
@@ Coverage Diff @@
## master #90 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 359 362 +3
=========================================
+ Hits 359 362 +3
| Impacted Files | Coverage Δ | |
|---|---|---|
| printf.c | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update d3b9846...729dd39. Read the comment docs.
Since this is non-standard, I suggest you have a preprocessor define controlling whether %p support is compiled-in or not. Also, what systems print %p the way the library does right now?