summaryrefslogtreecommitdiff
path: root/lib/fwu_updates/fwu_mtd.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/fwu_updates/fwu_mtd.c')
-rw-r--r--lib/fwu_updates/fwu_mtd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/fwu_updates/fwu_mtd.c b/lib/fwu_updates/fwu_mtd.c
index b73111ae24d..69cd3d7001f 100644
--- a/lib/fwu_updates/fwu_mtd.c
+++ b/lib/fwu_updates/fwu_mtd.c
@@ -175,8 +175,10 @@ int fwu_gen_alt_info_from_mtd(char *buf, size_t len, struct mtd_info *mtd)
l = strlen(buf);
/* Replace the last ';' with '&' if there is another image. */
- if (i != CONFIG_FWU_NUM_IMAGES_PER_BANK - 1 && l)
- buf[l - 1] = '&';
+ if (i != CONFIG_FWU_NUM_IMAGES_PER_BANK - 1 && l) {
+ buf[l] = '&';
+ buf++;
+ }
len -= l;
buf += l;
}