]> git.sur5r.net Git - i3/i3status/commitdiff
Avoid assigning a new value to a var before using the old value
authorOlivier Gayot <olivier.gayot@sigexec.com>
Wed, 13 Jun 2018 07:53:50 +0000 (09:53 +0200)
committerOlivier Gayot <olivier.gayot@sigexec.com>
Wed, 20 Jun 2018 12:20:17 +0000 (14:20 +0200)
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
src/print_mem.c

index 46523d6ce67c48560622eb0d787bd2e798e6feca..a37fa2905c142fd9c65925b0cd83ca86e5faded8 100644 (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]))