Module: kamailio
Branch: master
Commit: 3a11426bdf0a4a458f2531689110fee84451da88
URL:
https://github.com/kamailio/kamailio/commit/3a11426bdf0a4a458f2531689110fee…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-01-12T17:05:21+01:00
kamcmd: double/float values printed without decimals when they are 0
- cope better with long (long) values stored in double fields
---
Modified: utils/kamcmd/kamcmd.c
---
Diff:
https://github.com/kamailio/kamailio/commit/3a11426bdf0a4a458f2531689110fee…
Patch:
https://github.com/kamailio/kamailio/commit/3a11426bdf0a4a458f2531689110fee…
---
diff --git a/utils/kamcmd/kamcmd.c b/utils/kamcmd/kamcmd.c
index f1cbc24d68..141f309aaf 100644
--- a/utils/kamcmd/kamcmd.c
+++ b/utils/kamcmd/kamcmd.c
@@ -427,7 +427,11 @@ void print_binrpc_val(struct binrpc_val* v, int ident)
printf("%c", (v->u.end)?'}':'{');
break;
case BINRPC_T_DOUBLE:
- printf("%f", v->u.fval);
+ if(v->u.fval == (double)((long long int)v->u.fval)) {
+ printf("%lld", (long long int)v->u.fval);
+ } else {
+ printf("%f", v->u.fval);
+ }
break;
default:
printf("ERROR: unknown type %d\n", v->type);