From a567e95ee1055e8ddb652f09fc5f831085421ce4 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 4 Nov 2016 10:33:47 +0100 Subject: [PATCH] fix compilation errors on windows --- coreapi/dial_plan.c | 8 ++++---- coreapi/linphonecore_utils.h | 2 +- coreapi/proxy.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/coreapi/dial_plan.c b/coreapi/dial_plan.c index 90bfc7627..2c36723d7 100644 --- a/coreapi/dial_plan.c +++ b/coreapi/dial_plan.c @@ -296,10 +296,10 @@ int linphone_dial_plan_lookup_ccc_from_iso(const char* iso) { return -1; } -const LinphoneDialPlan* linphone_dial_plan_by_ccc_as_ushort(unsigned short ccc) { +const LinphoneDialPlan* linphone_dial_plan_by_ccc_as_int(int ccc) { int i; - char ccc_as_char[4] = {0}; - snprintf(ccc_as_char,sizeof(ccc_as_char),"%i",ccc); + char ccc_as_char[16] = {0}; + snprintf(ccc_as_char,sizeof(ccc_as_char)-1,"%i",ccc); for(i=0;dial_plans[i].country!=NULL;++i){ if (strcmp(ccc_as_char,dial_plans[i].ccc)==0){ @@ -316,7 +316,7 @@ const LinphoneDialPlan* linphone_dial_plan_by_ccc(const char *ccc) { return &most_common_dialplan; } - return linphone_dial_plan_by_ccc_as_ushort(strtol(ccc,NULL,10)); + return linphone_dial_plan_by_ccc_as_int((int)strtol(ccc,NULL,10)); } const LinphoneDialPlan* linphone_dial_plan_get_all() { diff --git a/coreapi/linphonecore_utils.h b/coreapi/linphonecore_utils.h index 411608460..d7da908ac 100644 --- a/coreapi/linphonecore_utils.h +++ b/coreapi/linphonecore_utils.h @@ -137,7 +137,7 @@ LINPHONE_PUBLIC const LinphoneDialPlan* linphone_dial_plan_by_ccc(const char *cc * Find best match for given CCC * @return Return matching dial plan, or a generic one if none found **/ -LINPHONE_PUBLIC const LinphoneDialPlan* linphone_dial_plan_by_ccc_as_ushort(unsigned short ccc); +LINPHONE_PUBLIC const LinphoneDialPlan* linphone_dial_plan_by_ccc_as_int(int ccc); /** diff --git a/coreapi/proxy.c b/coreapi/proxy.c index ca875b07b..6203f1f19 100644 --- a/coreapi/proxy.c +++ b/coreapi/proxy.c @@ -633,7 +633,7 @@ char* linphone_proxy_config_normalize_phone_number(LinphoneProxyConfig *proxy, c ccc = linphone_dial_plan_lookup_ccc_from_e164(flatten); if (ccc>-1) { /*e164 like phone number*/ - dialplan = *linphone_dial_plan_by_ccc_as_ushort(ccc); + dialplan = *linphone_dial_plan_by_ccc_as_int(ccc); nationnal_significant_number = strstr(flatten, dialplan.ccc); if (nationnal_significant_number) { nationnal_significant_number +=strlen(dialplan.ccc);