From a9c10f8c414af28f0c10036e22673cb57f5b8478 Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Mon, 30 Jan 2012 18:32:05 -0500 Subject: [PATCH] FreeTDM - ISDN fix for get_trillium_val function --- .../ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c index bc53a42a7a..54e68f5d13 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c @@ -105,22 +105,22 @@ ftdm2trillium_t nsf_plan_codes[] = { static uint8_t get_trillium_val(ftdm2trillium_t *vals, uint8_t ftdm_val, uint8_t default_val) { ftdm2trillium_t *val = vals; - while(val++) { + do { if (val->ftdm_val == ftdm_val) { return val->trillium_val; } - } + } while (val++); return default_val; } static uint8_t get_ftdm_val(ftdm2trillium_t *vals, uint8_t trillium_val, uint8_t default_val) { ftdm2trillium_t *val = vals; - while(val++) { + do { if (val->trillium_val == trillium_val) { return val->ftdm_val; } - } + } while (val++); return default_val; }