BitOne / php-meminfo

PHP extension to get insight about memory usage
MIT License
1.08k stars 78 forks source link

Header : signed integer overflow #102

Open Geompse opened 4 years ago

Geompse commented 4 years ago

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...