Commit 9a23352c authored by Ghislain MARY's avatar Ghislain MARY

Stricter compilation options + new compilation error fixes.

parent 2e7e220c
......@@ -258,7 +258,7 @@ else()
list(APPEND STRICT_OPTIONS_CPP "-Wno-error=unknown-warning-option" "-Qunused-arguments" "-Wno-tautological-compare" "-Wno-unused-function" "-Wno-array-bounds")
endif()
if(ENABLE_STRICT)
list(APPEND STRICT_OPTIONS_CPP "-Werror" "-fno-strict-aliasing")
list(APPEND STRICT_OPTIONS_CPP "-Werror" "-Wextra" "-Wno-unused-parameter" "-fno-strict-aliasing")
endif()
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
......
......@@ -802,7 +802,7 @@ case "$target_os" in
;;
esac
if test "$strictness" = "yes" ; then
STRICT_OPTIONS="$STRICT_OPTIONS -Werror -Wno-error=deprecated-declarations -Wno-error=strict-prototypes"
STRICT_OPTIONS="$STRICT_OPTIONS -Werror -Wextra -Wno-unused-parameter -Wno-error=deprecated-declarations -Wno-error=strict-prototypes"
CFLAGS="$CFLAGS -fno-strict-aliasing"
fi
......
......@@ -133,8 +133,8 @@ static LPC_COMMAND *lpc_find_command(const char *name);
void linphonec_out(const char *fmt,...);
VideoParams lpc_video_params={-1,-1,-1,-1,0,TRUE};
VideoParams lpc_preview_params={-1,-1,-1,-1,0,TRUE};
VideoParams lpc_video_params={-1,-1,-1,-1,NULL,TRUE,FALSE};
VideoParams lpc_preview_params={-1,-1,-1,-1,NULL,TRUE,FALSE};
/***************************************************************************
*
......@@ -212,7 +212,8 @@ static LPC_COMMAND commands[] = {
"'ipv6 disable' : do not use ipv6 network."
},
{ "mute", lpc_cmd_mute_mic,
"Mute microphone and suspend voice transmission."
"Mute microphone and suspend voice transmission.",
NULL
},
{ "nat", lpc_cmd_nat, "Set nat address",
"'nat' : show nat settings.\n"
......@@ -228,7 +229,8 @@ static LPC_COMMAND commands[] = {
"'play <wav file>' : play a wav file."
},
{ "playbackgain", lpc_cmd_playback_gain,
"Adjust playback gain."
"Adjust playback gain.",
NULL
},
{ "proxy", lpc_cmd_proxy, "Manage proxies",
"'proxy list' : list all proxy setups.\n"
......@@ -269,7 +271,8 @@ static LPC_COMMAND commands[] = {
"'transfer <call id1> --to-call <call id2>': transfers the call with 'id1' to the destination of call 'id2' (attended transfer)\n"
},
{ "unmute", lpc_cmd_unmute_mic,
"Unmute microphone and resume voice transmission."
"Unmute microphone and resume voice transmission.",
NULL
},
{ "webcam", lpc_cmd_webcam, "Manage webcams",
"'webcam list' : list all known devices.\n"
......@@ -325,9 +328,11 @@ static LPC_COMMAND advanced_commands[] = {
"'snapshot <file path>': take a snapshot and records it in jpeg format into the supplied path\n"
},
{ "preview-snapshot", lpc_cmd_preview_snapshot, "Take a snapshot of currently captured video stream",
"'preview-snapshot <file path>': take a snapshot and records it in jpeg format into the supplied path\n"
"'preview-snapshot <file path>': take a snapshot and records it in jpeg format into the supplied path\n",
NULL
},
{ "vfureq", lpc_cmd_vfureq, "Request the other side to send VFU for the current call"
{ "vfureq", lpc_cmd_vfureq, "Request the other side to send VFU for the current call",
NULL
},
#endif
{ "states", lpc_cmd_states, "Show internal states of liblinphone, registrations and calls, according to linphonecore.h definitions",
......@@ -1909,7 +1914,7 @@ static int
linphonec_friend_delete(LinphoneCore *lc, int num)
{
const bctbx_list_t *friend = linphone_core_get_friend_list(lc);
unsigned int n;
int n;
for(n=0; friend!=NULL; friend=bctbx_list_next(friend), ++n )
{
......@@ -1922,13 +1927,13 @@ linphonec_friend_delete(LinphoneCore *lc, int num)
if (-1 == num)
{
unsigned int i;
int i;
for (i = 0 ; i < n ; i++)
linphonec_friend_delete(lc, 0);
return 0;
}
linphonec_out("No such friend %u\n", num);
linphonec_out("No such friend %i\n", num);
return 1;
}
......
......@@ -153,7 +153,7 @@ static void presence_response_event(void *op_base, const belle_sip_response_even
belle_sip_object_unref(op->refresher);
op->refresher=NULL;
}
if (expires>0){
if ((expires != NULL) && (belle_sip_header_expires_get_expires(expires) > 0)) {
op->refresher=belle_sip_client_transaction_create_refresher(client_transaction);
belle_sip_refresher_set_listener(op->refresher,presence_refresher_listener,op);
belle_sip_refresher_set_realm(op->refresher,op->base.realm);
......
......@@ -539,7 +539,7 @@ static void sdp_parse_media_ice_parameters(belle_sdp_media_description_t *media_
att_name = belle_sdp_attribute_get_name(attribute);
value = belle_sdp_attribute_get_value(attribute);
if ( (nb_ice_candidates < sizeof (stream->ice_candidates)/sizeof(SalIceCandidate))
if ((nb_ice_candidates < (int)(sizeof(stream->ice_candidates)/sizeof(SalIceCandidate)))
&& (keywordcmp("candidate", att_name) == 0)
&& (value != NULL)) {
SalIceCandidate *candidate = &stream->ice_candidates[nb_ice_candidates];
......
......@@ -130,6 +130,7 @@ BELLE_SIP_INSTANCIATE_CUSTOM_VPTR_BEGIN(LinphoneContactProvider)
(belle_sip_object_destroy_t) contact_provider_destroy,
NULL,/*no clone*/
NULL,/*no marshal*/
BELLE_SIP_DEFAULT_BUFSIZE_HINT
},
"",
// Pure virtual
......
......@@ -311,7 +311,7 @@ const LinphoneDialPlan* linphone_dial_plan_get_all() {
return dial_plans;
}
const bool_t linphone_dial_plan_is_generic(const LinphoneDialPlan *ccc) {
bool_t linphone_dial_plan_is_generic(const LinphoneDialPlan *ccc) {
if (strcmp(ccc->country, most_common_dialplan.country) == 0)
return TRUE;
return FALSE;
......
......@@ -3069,7 +3069,8 @@ static void configure_rtp_session_for_rtcp_xr(LinphoneCore *lc, LinphoneCall *ca
}
rtp_session_configure_rtcp_xr(session, &currentconfig);
}
void static start_dtls( MSMediaStreamSessions *sessions, const SalStreamDescription *sd,const SalStreamDescription *remote) {
static void start_dtls( MSMediaStreamSessions *sessions, const SalStreamDescription *sd,const SalStreamDescription *remote) {
if (sal_stream_description_has_dtls(sd) == TRUE) {
/*DTLS*/
SalDtlsRole salRole = sd->dtls_role;
......@@ -3083,7 +3084,8 @@ void static start_dtls( MSMediaStreamSessions *sessions, const SalStreamDescrip
}
}
}
void static start_dtls_on_all_streams(LinphoneCall *call) {
static void start_dtls_on_all_streams(LinphoneCall *call) {
SalMediaDescription *remote_desc = sal_call_get_remote_media_description(call->op);
SalMediaDescription *result_desc = sal_call_get_final_media_description(call->op);
if( remote_desc == NULL || result_desc == NULL ){
......@@ -3108,7 +3110,7 @@ void static start_dtls_on_all_streams(LinphoneCall *call) {
return;
}
void static set_dtls_fingerprint( MSMediaStreamSessions *sessions, const SalStreamDescription *sd,const SalStreamDescription *remote) {
static void set_dtls_fingerprint( MSMediaStreamSessions *sessions, const SalStreamDescription *sd,const SalStreamDescription *remote) {
if (sal_stream_description_has_dtls(sd) == TRUE) {
/*DTLS*/
SalDtlsRole salRole = sd->dtls_role;
......@@ -3121,7 +3123,7 @@ void static set_dtls_fingerprint( MSMediaStreamSessions *sessions, const SalStr
}
}
void static set_dtls_fingerprint_on_all_streams(LinphoneCall *call) {
static void set_dtls_fingerprint_on_all_streams(LinphoneCall *call) {
SalMediaDescription *remote_desc = sal_call_get_remote_media_description(call->op);
SalMediaDescription *result_desc = sal_call_get_final_media_description(call->op);
......
......@@ -137,7 +137,7 @@ LINPHONE_PUBLIC const LinphoneDialPlan* linphone_dial_plan_by_ccc(const char *cc
/**
* Return if given plan is generic
**/
LINPHONE_PUBLIC const bool_t linphone_dial_plan_is_generic(const LinphoneDialPlan *ccc);
LINPHONE_PUBLIC bool_t linphone_dial_plan_is_generic(const LinphoneDialPlan *ccc);
#ifdef __cplusplus
}
......
......@@ -77,7 +77,10 @@ static MSSndCardDesc proxycard={
NULL,
/*create_reader*/ NULL,
create_writer,
/*uninit,*/
NULL, /*uninit*/
NULL, /* duplicate */
NULL, /*unload */
NULL /*usage_hint */
};
LsdPlayer *linphone_sound_daemon_get_player(LinphoneSoundDaemon *obj){
......
......@@ -58,7 +58,7 @@ static PayloadType * opus_match(MSOfferAnswerContext *ctx, const bctbx_list_t *l
}
static MSOfferAnswerContext *opus_offer_answer_create_context(void){
static MSOfferAnswerContext opus_oa = {opus_match, NULL};
static MSOfferAnswerContext opus_oa = {opus_match, NULL, NULL};
return &opus_oa;
}
......@@ -84,7 +84,7 @@ static PayloadType * g729A_match(MSOfferAnswerContext *ctx, const bctbx_list_t *
}
static MSOfferAnswerContext *g729a_offer_answer_create_context(void){
static MSOfferAnswerContext g729_oa = {g729A_match, NULL};
static MSOfferAnswerContext g729_oa = {g729A_match, NULL, NULL};
return &g729_oa;
}
......@@ -122,7 +122,7 @@ static PayloadType * red_match(MSOfferAnswerContext *ctx, const bctbx_list_t *lo
}
static MSOfferAnswerContext *red_offer_answer_create_context(void){
static MSOfferAnswerContext red_oa = {red_match, NULL};
static MSOfferAnswerContext red_oa = {red_match, NULL, NULL};
return &red_oa;
}
......
......@@ -304,15 +304,21 @@ static int sqlite3bctbx_Open(sqlite3_vfs *pVfs, const char *fName, sqlite3_file
sqlite3bctbx_Close, /* xClose */
sqlite3bctbx_Read, /* xRead */
sqlite3bctbx_Write, /* xWrite */
0, /*xTruncate*/
NULL, /* xTruncate */
sqlite3bctbx_Sync,
sqlite3bctbx_FileSize,
sqlite3bctbx_nolockLock,
sqlite3bctbx_nolockUnlock,
sqlite3bctbx_nolockCheckReservedLock,
sqlite3bctbx_FileControl,
0, /*xSectorSize*/
NULL, /* xSectorSize */
sqlite3bctbx_DeviceCharacteristics,
NULL, /* xShmMap */
NULL, /* xShmLock */
NULL, /* xShmBarrier */
NULL, /* xShmUnmap */
NULL, /* xFetch */
NULL, /* xUnfetch */
};
sqlite3_bctbx_file_t * pFile = (sqlite3_bctbx_file_t*)p; /*File handle sqlite3_bctbx_file_t*/
......@@ -357,23 +363,28 @@ static int sqlite3bctbx_Open(sqlite3_vfs *pVfs, const char *fName, sqlite3_file
sqlite3_vfs *sqlite3_bctbx_vfs_create(void){
static sqlite3_vfs bctbx_vfs = {
1, /* iVersion */
sizeof(sqlite3_bctbx_file_t), /* szOsFile */
MAXPATHNAME, /* mxPathname */
0, /* pNext */
LINPHONE_SQLITE3_VFS, /* zName */
0, /* pAppData */
sqlite3bctbx_Open, /* xOpen */
0, /* xDelete */
0, /* xAccess */
0, /* xFullPathname */
0, /* xDlOpen */
0, /* xDlError */
0, /* xDlSym */
0, /* xDlClose */
0, /* xRandomness */
0, /* xSleep */
0, /* xCurrentTime */
1, /* iVersion */
sizeof(sqlite3_bctbx_file_t), /* szOsFile */
MAXPATHNAME, /* mxPathname */
NULL, /* pNext */
LINPHONE_SQLITE3_VFS, /* zName */
NULL, /* pAppData */
sqlite3bctbx_Open, /* xOpen */
NULL, /* xDelete */
NULL, /* xAccess */
NULL, /* xFullPathname */
NULL, /* xDlOpen */
NULL, /* xDlError */
NULL, /* xDlSym */
NULL, /* xDlClose */
NULL, /* xRandomness */
NULL, /* xSleep */
NULL, /* xCurrentTime */
NULL, /* xGetLastError */
NULL, /* xCurrentTimeInt64 */
NULL, /* xSetSystemCall */
NULL, /* xGetSystemCall */
NULL, /* xNextSystemCall */
};
return &bctbx_vfs;
}
......
......@@ -340,7 +340,8 @@ Daemon::Daemon(const char *config_path, const char *factory_config_path, const c
linphone_core_disable_logs();
}
LinphoneCoreVTable vtable = { 0 };
LinphoneCoreVTable vtable;
memset(&vtable, 0, sizeof(vtable));
vtable.call_state_changed = callStateChanged;
vtable.call_stats_updated = callStatsUpdated;
vtable.dtmf_received = dtmfReceived;
......@@ -618,8 +619,9 @@ void Daemon::sendResponse(const Response &resp) {
}
char *Daemon::readPipe(char *buffer, int buflen) {
struct pollfd pfd[2] = { { 0 }, { 0 } };
struct pollfd pfd[2];
int nfds = 1;
memset(&pfd[0], 0, sizeof(pfd));
if (mServerFd != -1) {
pfd[0].events = POLLIN;
pfd[0].fd = mServerFd;
......
......@@ -148,7 +148,7 @@ static gboolean linphone_gtk_process_buddy_lookup(GtkWidget *w){
return FALSE;
}
bls=req->status;
if (last_state==bls) return TRUE;
if (last_state==(int)bls) return TRUE;
switch(bls){
case BuddyLookupNone:
......
......@@ -1030,7 +1030,7 @@ static gboolean grab_focus(GtkWidget *w){
return FALSE;
}
void linphone_gtk_viewswitch_changed(GtkNotebook *notebook, GtkWidget *page, guint page_num, gpointer user_data){
void linphone_gtk_viewswitch_changed(GtkNotebook *notebook, GtkWidget *page, gint page_num, gpointer user_data){
GtkWidget *main_window = linphone_gtk_get_main_window();
GtkWidget *friendlist = linphone_gtk_get_widget(main_window,"contact_list");
GtkWidget *w = (GtkWidget*)g_object_get_data(G_OBJECT(friendlist),"chatview");
......
......@@ -448,17 +448,16 @@ static void _bc_status_notifier_method_call_cb(
static void _bc_status_notifier_bus_acquired_cb(GDBusConnection *conn, const gchar *name, BcStatusNotifier *sn) {
char *interface_name = g_strdup_printf("%s.%s", sn->params->prefix, ITEM_NAME);
char *item_path = g_strdup_printf("/%s", ITEM_NAME);
GDBusInterfaceVTable vtable = {
(GDBusInterfaceMethodCallFunc)_bc_status_notifier_method_call_cb,
(GDBusInterfaceGetPropertyFunc)_bc_status_notifier_get_property_cb,
NULL
};
GDBusInterfaceVTable vtable;
GDBusNodeInfo *node_info = g_dbus_node_info_new_for_xml(STATUS_NOTIFIER_INTROSPECTION_DATA, NULL);
GDBusInterfaceInfo *interface = g_dbus_node_info_lookup_interface(
node_info,
interface_name
);
memset(&vtable, 0, sizeof(vtable));
vtable.method_call = (GDBusInterfaceMethodCallFunc)_bc_status_notifier_method_call_cb;
vtable.get_property = (GDBusInterfaceGetPropertyFunc)_bc_status_notifier_get_property_cb;
g_free(interface_name);
sn->conn = conn;
......
......@@ -236,14 +236,14 @@ void linphone_gtk_visibility_set(const char *hiddens, const char *window_name, G
int len;
for(b=i=hiddens;*i!='\0';++i){
if (*i==' '){
len=MIN(i-b,sizeof(item)-1);
len=MIN(i-b,(int)sizeof(item)-1);
strncpy(item,b,len);
item[len]='\0';
b=i+1;
parse_item(item,window_name,w,show);
}
}
len=MIN(i-b,sizeof(item)-1);
len=MIN(i-b,(int)sizeof(item)-1);
if (len>0){
strncpy(item,b,len);
item[len]='\0';
......
......@@ -294,7 +294,8 @@ MSFilterDesc audio_bypass_snd_read_desc = {
audio_bypass_snd_read_process,
audio_bypass_snd_read_postprocess,
audio_bypass_snd_read_uninit,
audio_bypass_snd_read_methods
audio_bypass_snd_read_methods,
0
};
static void audio_bypass_snd_write_init(MSFilter *f) {
......@@ -366,7 +367,8 @@ MSFilterDesc audio_bypass_snd_write_desc = {
audio_bypass_snd_write_process,
audio_bypass_snd_write_postprocess,
audio_bypass_snd_write_uninit,
audio_bypass_snd_write_methods
audio_bypass_snd_write_methods,
0
};
static MSFilter* audio_bypass_snd_card_create_reader(MSSndCard *sndcard) {
......@@ -394,6 +396,9 @@ MSSndCardDesc audio_bypass_snd_card_desc = {
NULL,
audio_bypass_snd_card_create_reader,
audio_bypass_snd_card_create_writer,
NULL,
NULL,
NULL,
NULL
};
......
......@@ -3426,7 +3426,8 @@ static void call_with_generic_cn(void) {
ms_free(audio_file_with_silence);
bc_free(recorded_file);
}
void static call_state_changed_2(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState cstate, const char *msg){
static void call_state_changed_2(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState cstate, const char *msg){
LCSipTransports sip_tr;
if (cstate==LinphoneCallReleased) {
/*to make sure transport is changed*/
......@@ -3437,7 +3438,8 @@ void static call_state_changed_2(LinphoneCore *lc, LinphoneCall *call, LinphoneC
linphone_core_set_sip_transports(lc,&sip_tr);
}
}
void static call_state_changed_3(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState cstate, const char *msg){
static void call_state_changed_3(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState cstate, const char *msg){
/*just to check multi listener in such situation*/
char* to=linphone_address_as_string(linphone_call_get_call_log(call)->to);
char* from=linphone_address_as_string(linphone_call_get_call_log(call)->from);
......@@ -3449,7 +3451,6 @@ void static call_state_changed_3(LinphoneCore *lc, LinphoneCall *call, LinphoneC
ms_free(from);
}
static void call_with_transport_change_base(bool_t succesfull_call) {
LCSipTransports sip_tr;
LinphoneCoreManager* marie;
......@@ -3583,9 +3584,10 @@ static void call_with_complex_late_offering(void){
LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc");
LinphoneCall* call_pauline;
LinphoneCall* call_marie;
LinphoneVideoPolicy vpol = {TRUE, TRUE};
LinphoneVideoPolicy vpol;
bool_t call_ok;
vpol.automatically_initiate = vpol.automatically_accept = TRUE;
linphone_core_enable_video_capture(pauline->lc, TRUE);
linphone_core_enable_video_display(pauline->lc, TRUE);
linphone_core_enable_video_capture(marie->lc, TRUE);
......@@ -3931,7 +3933,7 @@ static void rtptm_destroy(RtpTransportModifier *rtptm) {
}
// This is the callback called when the state of the call change
void static call_state_changed_4(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState cstate, const char *msg) {
static void call_state_changed_4(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState cstate, const char *msg) {
int i = 0;
// To add a custom RTP transport modifier, we have to do it before the call is running, but after the RTP session is created.
......
......@@ -964,34 +964,42 @@ end:
}
static void call_with_ice_video_added(void) {
LinphoneVideoPolicy vpol = { TRUE, TRUE };
LinphoneVideoPolicy vpol;
vpol.automatically_initiate = vpol.automatically_accept = TRUE;
_call_with_ice_video(vpol, vpol, TRUE, FALSE, TRUE, FALSE);
}
static void call_with_ice_video_added_2(void) {
LinphoneVideoPolicy vpol = { TRUE, TRUE };
LinphoneVideoPolicy vpol;
vpol.automatically_initiate = vpol.automatically_accept = TRUE;
_call_with_ice_video(vpol, vpol, TRUE, FALSE, FALSE, TRUE);
}
static void call_with_ice_video_added_3(void) {
LinphoneVideoPolicy vpol = { TRUE, TRUE };
LinphoneVideoPolicy vpol;
vpol.automatically_initiate = vpol.automatically_accept = TRUE;
_call_with_ice_video(vpol, vpol, FALSE, TRUE, TRUE, FALSE);
}
static void call_with_ice_video_added_and_refused(void) {
LinphoneVideoPolicy caller_policy = { TRUE, TRUE };
LinphoneVideoPolicy callee_policy = { FALSE, FALSE };
LinphoneVideoPolicy caller_policy;
LinphoneVideoPolicy callee_policy;
caller_policy.automatically_initiate = caller_policy.automatically_accept = TRUE;
callee_policy.automatically_initiate = callee_policy.automatically_accept = FALSE;
_call_with_ice_video(caller_policy, callee_policy, TRUE, FALSE, FALSE, FALSE);
}
static void call_with_ice_video_added_with_video_policies_to_false(void) {
LinphoneVideoPolicy vpol = { FALSE, FALSE };
LinphoneVideoPolicy vpol;
vpol.automatically_initiate = vpol.automatically_accept = FALSE;
_call_with_ice_video(vpol, vpol, FALSE, TRUE, FALSE, FALSE);
}
static void call_with_ice_video_declined_then_added_by_callee(void) {
LinphoneVideoPolicy caller_policy = { TRUE, TRUE };
LinphoneVideoPolicy callee_policy = { FALSE, FALSE };
LinphoneVideoPolicy caller_policy;
LinphoneVideoPolicy callee_policy;
caller_policy.automatically_initiate = caller_policy.automatically_accept = TRUE;
callee_policy.automatically_initiate = callee_policy.automatically_accept = FALSE;
_call_with_ice_video(caller_policy, callee_policy, FALSE, TRUE, FALSE, FALSE);
}
......@@ -999,10 +1007,11 @@ static void call_with_ice_video_and_rtt(void) {
LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc");
bool_t call_ok;
LinphoneVideoPolicy policy = { TRUE, TRUE };
LinphoneVideoPolicy policy;
LinphoneCallParams *params = NULL;
LinphoneCall *marie_call = NULL;
policy.automatically_initiate = policy.automatically_accept = TRUE;
linphone_core_set_video_policy(pauline->lc, &policy);
linphone_core_set_video_policy(marie->lc, &policy);
linphone_core_enable_video_capture(marie->lc, TRUE);
......@@ -1396,11 +1405,12 @@ static void classic_video_entry_phone_setup(void) {
LinphoneCallParams *early_media_params = NULL;
LinphoneCallParams *in_call_params = NULL;
LinphoneCall *callee_call = NULL;
LinphoneVideoPolicy vpol = { TRUE, TRUE };
LinphoneVideoPolicy vpol;
bctbx_list_t *lcs = NULL;
int retry = 0;
bool_t ok;
vpol.automatically_initiate = vpol.automatically_accept = TRUE;
lcs = bctbx_list_append(lcs, caller_mgr->lc);
lcs = bctbx_list_append(lcs, callee_mgr->lc);
......
......@@ -91,7 +91,7 @@ void file_transfer_received(LinphoneChatMessage *msg, const LinphoneContent* con
linphone_chat_message_set_user_data(msg, NULL);
fclose(file);
} else { /* store content on a file*/
if (fwrite(linphone_buffer_get_content(buffer),linphone_buffer_get_size(buffer),1,file)==-1){
if (fwrite(linphone_buffer_get_content(buffer),linphone_buffer_get_size(buffer),1,file)==0){
ms_error("file_transfer_received(): write() failed: %s",strerror(errno));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment