aboutsummaryrefslogtreecommitdiffstats
path: root/tools/firmware-utils/src/ptgen.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/firmware-utils/src/ptgen.c')
-rw-r--r--tools/firmware-utils/src/ptgen.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/firmware-utils/src/ptgen.c b/tools/firmware-utils/src/ptgen.c
index 04f4ec8629..8466d35bcc 100644
--- a/tools/firmware-utils/src/ptgen.c
+++ b/tools/firmware-utils/src/ptgen.c
@@ -93,7 +93,9 @@ static long to_kbytes(const char *string) {
}
/* result: number + 1024^(exp) */
- return result * ((2 << ((10 * exp) - 1)) ?: 1);
+ if (exp == 0)
+ return result;
+ return result * (2 << ((10 * exp) - 1));
}
/* convert the sector number into a CHS value for the partition table */