MCPcopy Create free account
hub / github.com/acl-dev/acl / test_snprintf

Function test_snprintf

lib_acl_cpp/src/acl_cpp_test.cpp:17–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15}
16
17void test_snprintf(void)
18{
19 char buf[10];
20 const char* s9 = "xxxxxxxxx";
21 const char* s10 = "xxxxxxxxxx";
22 const char* s11 = "xxxxxxxxxxx";
23 int ret;
24
25 memset(buf, 0, sizeof(buf));
26 ret = safe_snprintf(buf, sizeof(buf), "%s", s9);
27 printf("buf size: %d, string len: %d, ret: %d, buf: %s\r\n",
28 (int) sizeof(buf), (int) strlen(s9), ret, buf);
29
30 memset(buf, 0, sizeof(buf));
31 ret = safe_snprintf(buf, sizeof(buf), "%s", s10);
32 printf("buf size: %d, string len: %d, ret: %d, buf: %s\r\n",
33 (int) sizeof(buf), (int) strlen(s10), ret, buf);
34
35 memset(buf, 0, sizeof(buf));
36 ret = safe_snprintf(buf, sizeof(buf), "%s", s11);
37 printf("buf size: %d, string len: %d, ret: %d, buf: %s\r\n",
38 (int) sizeof(buf), (int) strlen(s11), ret, buf);
39}
40
41}

Callers 1

mainFunction · 0.85

Calls 1

safe_snprintfFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…