lib/flash: Fix version side being interpreted backwards
authorSam Mendoza-Jonas <sam@mendozajonas.com>
Fri, 4 Mar 2016 23:20:33 +0000 (10:20 +1100)
committerSam Mendoza-Jonas <sam@mendozajonas.com>
Fri, 4 Mar 2016 23:27:27 +0000 (10:27 +1100)
Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
lib/flash/flash.c

index 1056c635a4236ce5163ebba3bb0b562ac8bb1f83..b6188a07a3340d05def3b73300d2c39d201deb0a 100644 (file)
@@ -163,7 +163,7 @@ int flash_parse_version(void *ctx, char ***versions, bool current)
        if (!current && !info->other_side)
                return 0;
 
-       cur_info = current ? info->other_side : info;
+       cur_info = !current ? info->other_side : info;
 
        len = cur_info->attr_data_len -  ecc_size(cur_info->attr_data_len);
        buffer = talloc_array(cur_info, char, len);