aboutsummaryrefslogtreecommitdiffstats
path: root/src/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/command.c')
-rw-r--r--src/command.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/command.c b/src/command.c
index 2d00aaf4..a1ea4a7c 100644
--- a/src/command.c
+++ b/src/command.c
@@ -139,15 +139,17 @@ _sendf(uint8_t parserid, ...)
param_types++;
uint32_t v;
switch (t) {
- case PT_uint32:
- case PT_int32:
+ case PT_byte:
case PT_uint16:
+ v = va_arg(args, unsigned int);
+ goto encode_int;
case PT_int16:
- case PT_byte:
- if (t >= PT_uint16)
- v = va_arg(args, int) & 0xffff;
- else
- v = va_arg(args, uint32_t);
+ v = (int32_t)va_arg(args, int);
+ goto encode_int;
+ case PT_uint32:
+ case PT_int32:
+ v = va_arg(args, uint32_t);
+ encode_int:
p = encode_int(p, v);
break;
case PT_string: {