Skip to content
Snippets Groups Projects
Commit b48f5be7 authored by Arun Muthusamy's avatar Arun Muthusamy
Browse files

swap sprintf to snprintf

parent 48f62656
No related branches found
No related tags found
No related merge requests found
......@@ -642,7 +642,7 @@ struct json_object *mobile_delete_apn_profile_hilink(int profile_name_location)
struct write_result *result;
struct json_object *result_json;
sprintf(post_query, "<request><Delete>%d</Delete><SetDefault>1</SetDefault><Modify>0</Modify></request>", profile_name_location);
snprintf(post_query, 512, "<request><Delete>%d</Delete><SetDefault>1</SetDefault><Modify>0</Modify></request>", profile_name_location);
result = post_request(sess_tok_url, api_url, post_query);
if (!result)
......@@ -671,7 +671,7 @@ struct json_object *mobile_sms_read_hilink(int sms_location)
struct write_result *result;
struct json_object *result_json;
sprintf(post_query, "<request><Index>%d</Index></request>", sms_location);
snprintf(post_query, 256, "<request><Index>%d</Index></request>", sms_location);
result = post_request(sess_tok_url, api_url, post_query);
if (!result)
......@@ -700,7 +700,7 @@ struct json_object *mobile_sms_delete_hilink(int sms_location)
struct write_result *result;
struct json_object *result_json;
sprintf(post_query, "<request><Index>%d</Index></request>", sms_location);
snprintf(post_query, 256, "<request><Index>%d</Index></request>", sms_location);
result = post_request(sess_tok_url, api_url, post_query);
if (!result)
......@@ -838,7 +838,7 @@ struct json_object *mobile_set_connection_type_hilink(int connection_type)
struct write_result *result;
struct json_object *result_json;
sprintf(post_query, "<request><NetworkMode>%d</NetworkMode><NetworkBand>3FFFFFFF</NetworkBand><LTEBand>7FFFFFFFFFFFFFFF</LTEBand></request>", connection_type);
snprintf(post_query, 256, "<request><NetworkMode>%d</NetworkMode><NetworkBand>3FFFFFFF</NetworkBand><LTEBand>7FFFFFFFFFFFFFFF</LTEBand></request>", connection_type);
result = post_request(sess_tok_url, api_url, post_query);
if (!result)
......@@ -867,7 +867,7 @@ struct json_object *data_roaming(int action)
struct write_result *result;
struct json_object *result_json;
sprintf(post_query, "<request><RoamAutoConnectEnable>%d</RoamAutoConnectEnable><MaxIdelTime>600</MaxIdelTime><ConnectMode>0</ConnectMode><MTU>1500</MTU><auto_dial_switch>1</auto_dial_switch><pdp_always_on>0</pdp_always_on></request>", action);
snprintf(post_query, 256, "<request><RoamAutoConnectEnable>%d</RoamAutoConnectEnable><MaxIdelTime>600</MaxIdelTime><ConnectMode>0</ConnectMode><MTU>1500</MTU><auto_dial_switch>1</auto_dial_switch><pdp_always_on>0</pdp_always_on></request>", action);
result = post_request(sess_tok_url, api_url, post_query);
if (!result)
......@@ -908,7 +908,7 @@ struct json_object *pin_action(char *type, char *current_pin, char *new_pin, cha
struct write_result *result;
struct json_object *result_json;
sprintf(post_query, "<request><OperateType>%s</OperateType><CurrentPin>%s</CurrentPin><NewPin>%s</NewPin><PukCode>%s</PukCode></request>", type, current_pin, new_pin, puk);
sprintf(post_query, 256, "<request><OperateType>%s</OperateType><CurrentPin>%s</CurrentPin><NewPin>%s</NewPin><PukCode>%s</PukCode></request>", type, current_pin, new_pin, puk);
result = post_request(sess_tok_url, api_url, post_query);
if (!result)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment