From 607cceb5b0050c302f9538a1f47b435f55d6a6f7 Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Tue, 11 Dec 2018 08:33:18 +0200 Subject: [PATCH] simplified implementation of call_status API function --- app/src/main/cpp/baresip.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/src/main/cpp/baresip.c b/app/src/main/cpp/baresip.c index cce869b6..fac095ab 100644 --- a/app/src/main/cpp/baresip.c +++ b/app/src/main/cpp/baresip.c @@ -1173,12 +1173,9 @@ Java_com_tutpro_baresip_Api_call_1status(JNIEnv *env, jobject thiz, jstring java (*env)->ReleaseStringUTFChars(env, javaCall, native_call); struct call *call = (struct call *) strtoul(native_call, NULL, 10); char status_buf[256]; - int len = re_snprintf(&(status_buf[0]), 256, "%H", call_status, call); + int len = re_snprintf(&(status_buf[0]), 255, "%H", call_status, call); if (len != -1) { - if (len < 256) - status_buf[len] = '\0'; - else - status_buf[255] = '\0'; + status_buf[len] = '\0'; } else { LOGE("failed to get call status\n"); status_buf[0] = '\0';