php-meminfo icon indicating copy to clipboard operation
php-meminfo copied to clipboard

Header : signed integer overflow

Open Geompse opened this issue 5 years ago • 0 comments

When any of the memory usage values exceeds 2 147 483 648, on my system it gets generated in the JSON file as a negative integer. This is a normal behavior for sprintf when called with %d : the argument is treated as an integer and presented as a signed decimal number. You should replace %d with %lu : long unsigned decimal number. %ld is a working replacement too, but since those values can't be negative...

Geompse avatar Nov 26 '19 18:11 Geompse