From 9d5eb0737be55885bf9b14da8b554cae256dc5a6 Mon Sep 17 00:00:00 2001 From: Stefan Knoblich Date: Fri, 10 Feb 2012 13:24:57 +0100 Subject: [PATCH] [FreeTDM] Fix a couple of ftdm_log() format string errors. ... that could cause segmentation faults. Caught while working on __check_printf() support for ftdm_log(). Signed-off-by: Stefan Knoblich --- libs/freetdm/src/ftdm_config.c | 3 ++- libs/freetdm/src/ftdm_threadmutex.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/freetdm/src/ftdm_config.c b/libs/freetdm/src/ftdm_config.c index 1b023e93eb..4dfc395e06 100644 --- a/libs/freetdm/src/ftdm_config.c +++ b/libs/freetdm/src/ftdm_config.c @@ -255,7 +255,8 @@ FT_DECLARE (int) ftdm_config_get_cas_bits(char *strvalue, unsigned char *outbits if ('1' == cas_bits[x]) { *outbits |= bit; } else if ('0' != cas_bits[x]) { - ftdm_log(FTDM_LOG_ERROR, "Invalid CAS pattern specified: %s, just 0 or 1 allowed for each bit\n"); + ftdm_log(FTDM_LOG_ERROR, "Invalid CAS pattern specified: %s, just 0 or 1 allowed for each bit\n", + strvalue); return -1; } bit >>= 1; diff --git a/libs/freetdm/src/ftdm_threadmutex.c b/libs/freetdm/src/ftdm_threadmutex.c index 56653811fa..20b85ae91e 100644 --- a/libs/freetdm/src/ftdm_threadmutex.c +++ b/libs/freetdm/src/ftdm_threadmutex.c @@ -472,7 +472,7 @@ FT_DECLARE(ftdm_status_t) ftdm_interrupt_signal(ftdm_interrupt_t *interrupt) * otherwise users that never call interrupt wait eventually will * eventually have the pipe buffer filled */ if ((err = write(interrupt->writefd, "w", 1)) != 1) { - ftdm_log(FTDM_LOG_ERROR, "Failed to signal interrupt: %s\n", errno, strerror(errno)); + ftdm_log(FTDM_LOG_ERROR, "Failed to signal interrupt: %s\n", strerror(errno)); return FTDM_FAIL; } }