Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix wrong type of arguments to formatting function #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk_src/internal_inc/gateway_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
/* The format of bind cmd payload */
#define GATEWAY_PAYLOAD_OP_FMT \
"{\"type\":\"%s\",\"payload\":{\"devices\":[{\"product_id\":\"%s\"," \
"\"device_name\":\"%s\",\"signature\":\"%s\",\"random\":%d,\"timestamp\":%d," \
"\"device_name\":\"%s\",\"signature\":\"%s\",\"random\":%d,\"timestamp\":%ld," \
"\"signmethod\":\"%s\",\"authtype\":\"%s\"}]}}"

/* Subdevice seesion status */
Expand Down
2 changes: 1 addition & 1 deletion sdk_src/internal_inc/qcloud_iot_http.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extern "C" {
#define QCLOUD_HTTP_HEADER_FORMAT \
"Accept: %s*/*\r\n" \
"X-TC-Algorithm: %s\r\n" \
"X-TC-Timestamp: %d\r\n" \
"X-TC-Timestamp: %ld\r\n" \
"X-TC-Nonce: %d\r\n" \
"X-TC-Signature: %s\r\n"

Expand Down
2 changes: 1 addition & 1 deletion sdk_src/protocol/websocket/utils_websocket_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static int _websocket_genmask_callback(wslay_event_context_ptr ctx, uint8_t *buf
{
srand((unsigned)time(NULL));
int nonce = rand() % 99999999999 + 10000;
HAL_Snprintf((char *)buf, len, "%0*d", len - 1, nonce);
HAL_Snprintf((char *)buf, len, "%0*d", (int)(len - 1), nonce);
return 0;
}

Expand Down