projects
/
openwrt
/
staging
/
yousong.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
firmware-utils: mkwrggimg: new tool for D-Link DAP-2695
[openwrt/staging/yousong.git]
/
tools
/
firmware-utils
/
src
/
ptgen.c
diff --git
a/tools/firmware-utils/src/ptgen.c
b/tools/firmware-utils/src/ptgen.c
index 04f4ec862980fb4995b3e2f25f29062ecf1efb57..8466d35bcc3f5364c318594b092ead2aae9e95b9 100644
(file)
--- 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 */