[PACKET_IO]format code style

This commit is contained in:
liuwentan
2022-08-11 11:18:14 +08:00
parent b471a6eac4
commit 4005e8d716
13 changed files with 67 additions and 66 deletions

View File

@@ -8,26 +8,6 @@
***********************************************************************************************
*/
#include <string.h>
#include "global_var.h"
struct stellar_engine g_engine_instance;
int strncpy_safe(char *dst, const char *src, size_t dst_size)
{
if (nullptr == dst || nullptr == src || dst_size == 0) {
return -1;
}
size_t slen = strlen(src);
if (slen >= dst_size) {
strncpy(dst, src, dst_size);
dst[dst_size - 1] = '\0';
} else {
strcpy(dst, src);
dst[slen - 1] = '\0';
}
return 0;
}
struct stellar_engine g_engine_instance;