summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOlivier Gayot <olivier.gayot@sigexec.com>2018-06-13 09:53:50 +0200
committerOlivier Gayot <olivier.gayot@sigexec.com>2018-06-20 14:20:17 +0200
commita6dd14c8c62e7e771ca76e9a5d897e8c90d1882a (patch)
tree7fd3f8b27f1c486f11f6aa52bdfa99d84a9c8dfa /src
parent598b76cc5332e196518a9ec6d722ebaeb3781a9c (diff)
Avoid assigning a new value to a var before using the old value
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
Diffstat (limited to 'src')
-rw-r--r--src/print_mem.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/print_mem.c b/src/print_mem.c
index 46523d6..a37fa29 100644
--- a/src/print_mem.c
+++ b/src/print_mem.c
@@ -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]))