aboutsummaryrefslogtreecommitdiffstats
path: root/src/cnetz/telegramm.c
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2016-10-07 07:52:17 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2016-10-07 07:52:17 +0200
commit0cec2f28be5e6890f60b333fd442f6cf72f69677 (patch)
tree325bb4f4330cc76d0899671f923bb43295ecbe49 /src/cnetz/telegramm.c
parentb205cfcf03b700128db4c1558278371cd13dbbd4 (diff)
Add check if fromat at PDEBUG() is consistent (like printf)
The bugs it found are fixed too.
Diffstat (limited to 'src/cnetz/telegramm.c')
-rw-r--r--src/cnetz/telegramm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/cnetz/telegramm.c b/src/cnetz/telegramm.c
index 91e2ec9..66945c6 100644
--- a/src/cnetz/telegramm.c
+++ b/src/cnetz/telegramm.c
@@ -22,6 +22,7 @@
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
+#include <inttypes.h>
#include <string.h>
#include <errno.h>
#include <math.h>
@@ -602,13 +603,13 @@ static void debug_parameter(char digit, uint64_t value)
if (parameter->value_names)
PDEBUG(DFRAME, DEBUG_DEBUG, " (%c) %s : %s\n", digit, parameter->param_name, parameter->value_names[value]);
else if (parameter->bits == 64)
- PDEBUG(DFRAME, DEBUG_DEBUG, " (%c) %s : 0x%016x\n", digit, parameter->param_name, value);
+ PDEBUG(DFRAME, DEBUG_DEBUG, " (%c) %s : 0x%016" PRIx64 "\n", digit, parameter->param_name, value);
else if (digit == 'X') {
char wahlziffern[17];
decode_dialstring(wahlziffern, value);
PDEBUG(DFRAME, DEBUG_DEBUG, " (%c) %s : '%s'\n", digit, parameter->param_name, wahlziffern);
} else
- PDEBUG(DFRAME, DEBUG_DEBUG, " (%c) %s : %d\n", digit, parameter->param_name, value);
+ PDEBUG(DFRAME, DEBUG_DEBUG, " (%c) %s : %" PRIu64 "\n", digit, parameter->param_name, value);
}
/* encode telegram to 70 bits
@@ -806,7 +807,7 @@ static char *assemble_telegramm(const telegramm_t *telegramm, int debug)
val >>= 1;
}
if (val)
- PDEBUG(DFRAME, DEBUG_ERROR, "Parameter '%c' value '0x%x' exceeds bit range!\n", parameter, value);
+ PDEBUG(DFRAME, DEBUG_ERROR, "Parameter '%c' value '0x%" PRIx64 "' exceeds bit range!\n", parameter, value);
i += j - 1;
}
bits[70] = '\0';