Skip to content

Commit

Permalink
Merge pull request #86 from mysterywolf/master
Browse files Browse the repository at this point in the history
memcpy改为rt_memcpy
  • Loading branch information
xiangxistu authored Jan 12, 2022
2 parents 686a3ad + 3ad722c commit 1d36bfb
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion inc/webclient.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
* Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
Expand Down
8 changes: 4 additions & 4 deletions samples/webclient_get_sample.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
* Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
Expand Down Expand Up @@ -78,7 +78,7 @@ static int webclient_get_comm(const char *uri)

do
{
bytes_read = webclient_read(session, (void *)buffer,
bytes_read = webclient_read(session, (void *)buffer,
content_length - content_pos > GET_RESP_BUFSZ ?
GET_RESP_BUFSZ : content_length - content_pos);
if (bytes_read <= 0)
Expand Down Expand Up @@ -131,7 +131,7 @@ static int webclient_get_smpl(const char *uri)
rt_kprintf("%c", response[index]);
}
rt_kprintf("\n");

if (response)
{
web_free(response);
Expand Down Expand Up @@ -202,7 +202,7 @@ int webclient_get_test(int argc, char **argv)
{
web_free(uri);
}

return RT_EOK;
}

Expand Down
4 changes: 2 additions & 2 deletions samples/webclient_post_sample.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
* Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
Expand Down Expand Up @@ -183,7 +183,7 @@ int webclient_post_test(int argc, char **argv)
rt_kprintf("web_post_test -s [uri] - webclient simplify post request test.\n");
return -RT_ERROR;
}

if (uri)
{
web_free(uri);
Expand Down
2 changes: 1 addition & 1 deletion samples/webclient_shard_download_sample.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
* Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
Expand Down
8 changes: 4 additions & 4 deletions src/webclient.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2019, RT-Thread Development Team
* Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
Expand Down Expand Up @@ -216,11 +216,11 @@ static int webclient_resolve_address(struct webclient_session *session, struct a
port_ptr = rt_strstr(host_addr + host_addr_len, ":");
if (port_ptr && (!path_ptr || (port_ptr < path_ptr)))
{
if (!path_ptr)
if (!path_ptr)
{
rt_strcpy(port_str, port_ptr + 1);
}
else
else
{
int port_len = path_ptr - port_ptr - 1;
rt_strncpy(port_str, port_ptr + 1, port_len);
Expand Down Expand Up @@ -270,7 +270,7 @@ static int webclient_resolve_address(struct webclient_session *session, struct a
goto __exit;
}

memcpy(host_addr_new, host_addr, host_addr_len);
rt_memcpy(host_addr_new, host_addr, host_addr_len);
host_addr_new[host_addr_len] = '\0';
session->host = host_addr_new;
}
Expand Down
2 changes: 1 addition & 1 deletion src/webclient_file.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
* Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
Expand Down

0 comments on commit 1d36bfb

Please sign in to comment.