Skip to content

Commit 17a85ed

Browse files
committed
lib: os: cbprintf: Fix double handling in package
Double vs long double handling was swapped in packaging. It was wrong in encoder and decoder so error gone unnoticed. Signed-off-by: Krzysztof Chruscinski <[email protected]>
1 parent d7d9b71 commit 17a85ed

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/os/cbprintf_complete.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,9 +1781,9 @@ static void pack_conversion(struct package_state *pst)
17811781
break;
17821782
case SPECIFIER_FP:
17831783
if (length_mod == LENGTH_UPPER_L) {
1784-
PACK_VALUE(pst, value->dbl);
1785-
} else {
17861784
PACK_VALUE(pst, value->ldbl);
1785+
} else {
1786+
PACK_VALUE(pst, value->dbl);
17871787
}
17881788
break;
17891789
case SPECIFIER_INVALID:
@@ -1891,9 +1891,9 @@ static void pull_pkg_args(struct cbprintf_state *state)
18911891
break;
18921892
case SPECIFIER_FP:
18931893
if (length_mod == LENGTH_UPPER_L) {
1894-
UNPACK_VALUE(state, value->dbl);
1895-
} else {
18961894
UNPACK_VALUE(state, value->ldbl);
1895+
} else {
1896+
UNPACK_VALUE(state, value->dbl);
18971897
}
18981898
break;
18991899
case SPECIFIER_INVALID:

0 commit comments

Comments
 (0)