Avoid assigning a new value to a var before using the old value

Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
This commit is contained in:
Olivier Gayot 2018-06-13 09:53:50 +02:00
parent 598b76cc53
commit a6dd14c8c6

View File

@ -39,10 +39,9 @@ static int print_bytes_human(char *outwalk, uint64_t bytes) {
*
*/
static long memory_absolute(const long mem_total, const char *size) {
long mem_absolute = -1;
char *endptr = NULL;
mem_absolute = strtol(size, &endptr, 10);
long mem_absolute = strtol(size, &endptr, 10);
if (endptr) {
while (endptr[0] != '\0' && isspace(endptr[0]))