summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-06-28 09:24:17 +0200
committerHarald Welte <laforge@gnumonks.org>2018-06-28 10:57:42 +0200
commit459a180877d410d491d7adb1fdf9cc12fd51ac99 (patch)
treeea1b41ecefa460b5fa933b1a585cc99a63714977 /src
parent79d49af93a45f184ad05ab6dc4fd662848333e50 (diff)
Don't call abort() directly, always use osmo_panic()
A loooong time ago, we introduced osmo_panic() as a wrapper around abort(). The advantage is, that this wrapper can be overridden, and that it will also work in embedded (bare iron) targets, where the abort simply translates to an infinite loop. Change-Id: I5a70eb65952cbc329bf96eacb428b07a9da32433
Diffstat (limited to 'src')
-rw-r--r--src/bitvec.c3
-rw-r--r--src/gsm/gsm0808_utils.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/bitvec.c b/src/bitvec.c
index 884eb025..0f56e3e9 100644
--- a/src/bitvec.c
+++ b/src/bitvec.c
@@ -44,6 +44,7 @@
#include <osmocom/core/bits.h>
#include <osmocom/core/bitvec.h>
+#include <osmocom/core/panic.h>
#define BITNUM_FROM_COMP(byte, bit) ((byte*8)+bit)
@@ -530,7 +531,7 @@ char bit_value_to_char(enum bit_value v)
case ONE: return '1';
case L: return 'L';
case H: return 'H';
- default: abort();
+ default: osmo_panic("unexpected input in bit_value_to_char"); return 'X';
}
}
diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c
index 080fc95b..73f02341 100644
--- a/src/gsm/gsm0808_utils.c
+++ b/src/gsm/gsm0808_utils.c
@@ -155,7 +155,7 @@ static uint8_t enc_speech_codec(struct msgb *msg,
/* See also 3GPP TS 48.008 3.2.2.103 Speech Codec List */
uint8_t header = 0;
uint8_t *old_tail;
- bool type_extended;
+ bool type_extended = false;
/* Note: Extended codec types are codec types that require 8 instead
* of 4 bit to fully specify the selected codec. In the following,