Home
last modified time | relevance | path

Searched refs:snprintf (Results 1 – 25 of 46) sorted by relevance

12

/bionic/tests/
Dstdio_test.cpp288 snprintf(buf, sizeof(buf), "%zd", v); in TEST()
294 EXPECT_EQ(23, snprintf(buf, sizeof(buf), "<%a>", 9990.235)); in TEST()
309 EXPECT_EQ(41, snprintf(buf, sizeof(buf), "<%La>", u.v)); in TEST()
314 EXPECT_EQ(41, snprintf(buf, sizeof(buf), "<%La>", u.v)); in TEST()
319 EXPECT_EQ(8, snprintf(buf, sizeof(buf), "<%La>", u.v)); in TEST()
329 EXPECT_EQ(3, snprintf(buf, sizeof(buf), "<%lc>", wc)); in TEST()
336 EXPECT_EQ(3, snprintf(buf, sizeof(buf), "<%C>", wc)); in TEST()
343 EXPECT_EQ(8, snprintf(buf, sizeof(buf), "<%ls>", ws)); in TEST()
348 EXPECT_EQ(4, snprintf(buf, sizeof(buf), "<%ls>", ws)); in TEST()
355 EXPECT_EQ(8, snprintf(buf, sizeof(buf), "<%S>", ws)); in TEST()
[all …]
Dftw_test.cpp34 snprintf(path, sizeof(path), "%s/dir", root); in MakeTree()
36 snprintf(path, sizeof(path), "%s/dir/sub", root); in MakeTree()
38 snprintf(path, sizeof(path), "%s/unreadable-dir", root); in MakeTree()
41 snprintf(path, sizeof(path), "%s/dangler", root); in MakeTree()
43 snprintf(path, sizeof(path), "%s/symlink", root); in MakeTree()
47 snprintf(path, sizeof(path), "%s/regular", root); in MakeTree()
Dinttypes_test.cpp27 snprintf(buf, sizeof(buf), "%" PRId##FMT_SUFFIX, int##TYPE_SUFFIX(123)); \
30 snprintf(buf, sizeof(buf), "%" PRIi##FMT_SUFFIX, int##TYPE_SUFFIX(123)); \
33 snprintf(buf, sizeof(buf), "%" PRIo##FMT_SUFFIX, int##TYPE_SUFFIX(123)); \
36 snprintf(buf, sizeof(buf), "%" PRIu##FMT_SUFFIX, uint##TYPE_SUFFIX(123)); \
39 snprintf(buf, sizeof(buf), "%" PRIx##FMT_SUFFIX, uint##TYPE_SUFFIX(123)); \
42 snprintf(buf, sizeof(buf), "%" PRIX##FMT_SUFFIX, uint##TYPE_SUFFIX(123)); \
Dsys_stat_test.cpp205 snprintf(linkname, sizeof(linkname), "%s.link", tf.path); in TEST()
218 snprintf(linkname, sizeof(linkname), "%s.link", tf.path); in TEST()
219 snprintf(target, sizeof(target), "%s.doesnotexist", tf.path); in TEST()
240 snprintf(linkname, sizeof(linkname), "%s.link", tf.path); in TEST()
262 snprintf(linkname, sizeof(linkname), "%s.link", tf.path); in TEST()
263 snprintf(target, sizeof(target), "%s.doesnotexist", tf.path); in TEST()
Dsystem_properties_test.cpp175 ret = snprintf(prop_name, PROP_NAME_MAX - 1, "property_%d", count); in TEST()
177 ret = snprintf(prop_value, PROP_VALUE_MAX - 1, "value_%d", count); in TEST()
193 ret = snprintf(prop_name, PROP_NAME_MAX - 1, "property_%d", i); in TEST()
195 ret = snprintf(prop_value, PROP_VALUE_MAX - 1, "value_%d", i); in TEST()
268 ret = snprintf(prop_name, PROP_NAME_MAX - 1, "property_%d.%d.%d", i, j, k); in TEST()
270 ret = snprintf(prop_value, PROP_VALUE_MAX - 1, "value_%d.%d.%d", i, j, k); in TEST()
284 ret = snprintf(prop_name, PROP_NAME_MAX - 1, "property_%d.%d.%d", i, j, k); in TEST()
286 ret = snprintf(prop_value, PROP_VALUE_MAX - 1, "value_%d.%d.%d", i, j, k); in TEST()
Dbug_26110743_test.cpp36 snprintf(buf, sizeof(buf), "/proc/self/fd/%d", fd); in ProcSelfReadlinkBody()
82 snprintf(buf, sizeof(buf), "/proc/%d/task/%d/fd/%d", mypid, mytid, fd); in ProcTaskFdReadlinkBody()
Dclang_fortify_tests.cpp365 snprintf(buf, sizeof(buf), "%d", unsigned_value); in testFormatStrings()
367 snprintf(buf, sizeof(buf), unknown_string, unsigned_value); in testFormatStrings()
479 EXPECT_FORTIFY_DEATH(snprintf(small_buffer, sizeof(small_buffer) + 1, "")); in FORTIFY_TEST()
/bionic/libc/dns/nameser/
Dns_print.c152 len = snprintf(tmp, sizeof(tmp), " %s %s", p_class(class), p_type(type)); in ns_sprintrrf()
215 len = snprintf(tmp, sizeof(tmp), "%lu", t); in ns_sprintrrf()
272 len = snprintf(tmp, sizeof(tmp), "%u ", t); in ns_sprintrrf()
290 len = snprintf(tmp, sizeof(tmp), "%u ", t); in ns_sprintrrf()
356 len = snprintf(t, sizeof(t), "%u %u ", order, preference); in ns_sprintrrf()
398 len = snprintf(t, sizeof(t), "%u %u %u ", priority, weight, port); in ns_sprintrrf()
429 len = snprintf(tmp, sizeof(tmp), " %u ( ", *rdata); in ns_sprintrrf()
446 len = snprintf(tmp, sizeof(tmp), "%d ", n); in ns_sprintrrf()
477 len = snprintf(tmp, sizeof(tmp), "0x%04x %u %u", in ns_sprintrrf()
499 n = snprintf(tmp, sizeof(tmp), " ; key_tag= %u", key_id); in ns_sprintrrf()
[all …]
Dns_name.c1009 i = snprintf(dn, eom - dn, "\\[x"); in decode_bitstring()
1014 i = snprintf(dn, eom - dn, "%02x", *cp & 0xff); in decode_bitstring()
1021 i = snprintf(dn, eom - dn, "%02x", tc & (0xff << (8 - b))); in decode_bitstring()
1027 i = snprintf(dn, eom - dn, "%1x", in decode_bitstring()
1033 i = snprintf(dn, eom - dn, "/%d]", blen); in decode_bitstring()
Dns_ttl.c154 len = (size_t)snprintf(tmp, sizeof(tmp), "%d%c", t, s); in fmt1()
/bionic/libc/bionic/
Dgrp_pwd.cpp111 snprintf(state->name_buffer_, sizeof(state->name_buffer_), "%s", iinfo->name); in android_iinfo_to_passwd()
112 snprintf(state->dir_buffer_, sizeof(state->dir_buffer_), "/"); in android_iinfo_to_passwd()
113 snprintf(state->sh_buffer_, sizeof(state->sh_buffer_), "/bin/sh"); in android_iinfo_to_passwd()
123 snprintf(state->group_name_buffer_, sizeof(state->group_name_buffer_), "%s", iinfo->name); in android_iinfo_to_group()
370 snprintf(buffer, bufferlen, "u%u_i%u", userid, appid - AID_ISOLATED_START); in print_app_name_from_uid()
373 snprintf(buffer, bufferlen, "u%u_%s", userid, android_id_info->name); in print_app_name_from_uid()
376 snprintf(buffer, bufferlen, "u%u_a%u", userid, appid - AID_APP_START); in print_app_name_from_uid()
384 snprintf(buffer, bufferlen, "u%u_i%u", userid, appid - AID_ISOLATED_START); in print_app_name_from_gid()
386 snprintf(buffer, bufferlen, "all_a%u", appid - AID_SHARED_GID_START); in print_app_name_from_gid()
388 snprintf(buffer, bufferlen, "u%u_a%u_ext_cache", userid, appid - AID_EXT_CACHE_GID_START); in print_app_name_from_gid()
[all …]
Dether_ntoa.c40 snprintf(buf, 18, "%02x:%02x:%02x:%02x:%02x:%02x", in ether_ntoa_r()
Dstrsignal.cpp58 size_t length = snprintf(buf, buf_len, "%s signal %d", prefix, signal_number); in __strsignal()
Dpthread_setname_np.cpp48 snprintf(comm_name, sizeof(comm_name), "/proc/self/task/%d/comm", in __open_task_comm_fd()
Dtmpfile.cpp145 snprintf(s, L_tmpnam, "%s/tmpnam.XXXXXXXXXX", dir); in tmpnam()
Dpty.cpp73 if (snprintf(buf, len, "/dev/pts/%u", pty_num) >= static_cast<int>(len)) { in ptsname_r()
/bionic/libc/private/
DFdPath.h22 snprintf(buf, sizeof(buf), "/proc/self/fd/%d", fd); in FdPath()
/bionic/libc/upstream-netbsd/lib/libc/regex/
Dregerror.c188 (void)snprintf(convbuf, sizeof convbuf, in regerror()
221 (void)snprintf(localbuf, buflen, "%d", r->code); in regatoi()
/bionic/libc/upstream-openbsd/lib/libc/net/
Dinet_ntoa.c48 (void)snprintf(b, sizeof(b), in inet_ntoa()
Dinet_ntop.c77 l = snprintf(tmp, sizeof(tmp), "%u.%u.%u.%u", in inet_ntop4()
175 advance = snprintf(tp, ep - tp, "%x", words[i]); in inet_ntop6()
/bionic/libc/dns/resolv/
Dres_debug.c601 snprintf(unname, sizeof(unname), "%d", number); /* XXX nonreentrant */ in sym_ntos()
618 snprintf(unname, sizeof(unname), "%d", number); /* XXX nonreentrant */ in sym_ntop()
638 snprintf(typebuf, sizeof(typebuf), "TYPE%d", type); in p_type()
674 snprintf(classbuf, sizeof(classbuf), "CLASS%d", class); in p_class()
716 default: snprintf(nbuf, sizeof(nbuf), "?0x%lx?", (u_long)option); in p_option()
729 snprintf(nbuf, sizeof(nbuf), "%u", value); in p_time()
758 snprintf(ret, sizeof(ret), "[af%d]", u.sin.sin_family); in p_sockun()
790 (void) snprintf(retbuf, sizeof(retbuf), "%lu.%.2lu", val/100, val%100); in precsize_ntoa()
1068 (void) snprintf(ascii, bufsiz, "; error: unknown LOC RR version"); in loc_ntoa()
1127 snprintf(ascii, bufsiz, in loc_ntoa()
[all …]
/bionic/benchmarks/
Dstdio_benchmark.cpp178 snprintf(buf, sizeof(buf), "this is just a literal string with no format specifiers"); in BM_stdio_printf_literal()
186 snprintf(buf, sizeof(buf), "this is a more typical error message with detail: %s", in BM_stdio_printf_s()
195 snprintf(buf, sizeof(buf), "this is a more typical error message with detail: %d", 123456); in BM_stdio_printf_d()
203 snprintf(buf, sizeof(buf), "this is a more typical error message with detail: %1$s", in BM_stdio_printf_1$s()
/bionic/libc/tzcode/
Dasctime.c106 snprintf(result, sizeof(result), /* Android change: use snprintf. */ in asctime_r()
Dstrftime.c363 snprintf(buf, sizeof(buf), "%"PRIdMAX, in _fmt()
365 else snprintf(buf, sizeof(buf), "%"PRIuMAX, in _fmt()
634 snprintf(buf, sizeof(buf), format, n); in _conv()
/bionic/libc/dns/net/
Dgetnameinfo.c232 snprintf(numserv, sizeof(numserv), "%u", ntohs(port)); in getnameinfo_inet()
421 n = snprintf(buf, bufsiz, "%u", sa6->sin6_scope_id); in ip6_sa2str()
439 n = snprintf(buf, bufsiz, "%u", sa6->sin6_scope_id); in ip6_sa2str()

12