/freebsd/lib/libc/tests/string/ |
H A D | strnlen_test.c | 32 for (size_t maxlen = 0; maxlen <= 64; maxlen++) { in ATF_TC_BODY() local 33 for (size_t len = 0; len <= maxlen; len++) { in ATF_TC_BODY() 38 size_t val = strnlen_fn(s, maxlen); in ATF_TC_BODY() 41 align, maxlen, len); in ATF_TC_BODY() 47 s[maxlen + 1] = '\0'; in ATF_TC_BODY() 48 val = strnlen_fn(s, maxlen); in ATF_TC_BODY() 51 align, maxlen, len); in ATF_TC_BODY() 58 s[maxlen + 1] = '/'; in ATF_TC_BODY() 65 size_t val = strnlen_fn(s, maxlen); in ATF_TC_BODY() 66 if (val != maxlen) { in ATF_TC_BODY() [all …]
|
/freebsd/crypto/openssl/crypto/bio/ |
H A D | bio_print.c | 41 size_t *maxlen, size_t *retlen, int *truncated, 89 size_t *maxlen, in _dopr() argument 111 if (ch == '\0' || (buffer == NULL && currlen >= *maxlen)) in _dopr() 119 if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch)) in _dopr() 234 if (!fmtint(sbuffer, buffer, &currlen, maxlen, value, 10, min, in _dopr() 262 if (!fmtint(sbuffer, buffer, &currlen, maxlen, value, in _dopr() 273 if (!fmtfp(sbuffer, buffer, &currlen, maxlen, fvalue, min, max, in _dopr() 285 if (!fmtfp(sbuffer, buffer, &currlen, maxlen, fvalue, min, max, in _dopr() 297 if (!fmtfp(sbuffer, buffer, &currlen, maxlen, fvalue, min, max, in _dopr() 312 if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, in _dopr() [all …]
|
/freebsd/crypto/openssh/openbsd-compat/ |
H A D | bsd-snprintf.c | 170 static int dopr(char *buffer, size_t maxlen, const char *format, 172 static int fmtstr(char *buffer, size_t *currlen, size_t maxlen, 174 static int fmtint(char *buffer, size_t *currlen, size_t maxlen, 176 static int fmtfp(char *buffer, size_t *currlen, size_t maxlen, 180 dopr(char *buffer, size_t maxlen, const char *format, va_list args_in) in dopr() argument 210 DOPR_OUTCH(buffer, currlen, maxlen, ch); in dopr() 321 if (fmtint(buffer, &currlen, maxlen, in dopr() 341 if (fmtint(buffer, &currlen, maxlen, value, in dopr() 361 if (fmtint(buffer, &currlen, maxlen, value, in dopr() 383 if (fmtint(buffer, &currlen, maxlen, value, in dopr() [all …]
|
H A D | strnlen.c | 28 strnlen(const char *str, size_t maxlen) in strnlen() argument 32 for (cp = str; maxlen != 0 && *cp != '\0'; cp++, maxlen--) in strnlen()
|
/freebsd/contrib/arm-optimized-routines/string/test/ |
H A D | strnlen.c | 53 test (const struct fun *fun, int align, size_t maxlen, size_t len) in test() argument 58 size_t e = maxlen < len ? maxlen : len; in test() 75 size_t mte_len = maxlen < len + 1 ? maxlen : len + 1; in test() 77 r = fun->fun (s, maxlen); in test() 83 fun->name, s, maxlen, len, r, e); in test() 99 for (int maxlen = 0; maxlen < LEN; maxlen++) in main() local 100 test (funtab + i, a, maxlen, n); in main()
|
H A D | memrchr.c | 51 size_t maxlen) in test() argument 55 char *f = seekpos < maxlen ? s + seekpos : NULL; in test() 71 s[((len ^ align) & 1) && seekpos < maxlen ? seekpos - 1 : len] = seekchar; in test() 73 s = tag_buffer (s, maxlen, fun->test_mte); in test() 74 p = fun->fun (s, seekchar, maxlen); in test() 75 untag_buffer (s, maxlen, fun->test_mte); in test() 81 seekchar, maxlen, p, f); in test()
|
H A D | memchr.c | 53 size_t maxlen) in test() argument 57 char *f = seekpos < maxlen ? s + seekpos : NULL; in test() 75 int mte_len = seekpos != -1 ? seekpos + 1 : maxlen; in test() 77 p = fun->fun (s, seekchar, maxlen); in test() 84 seekchar, maxlen, p, f); in test()
|
H A D | strncmp.c | 49 test (const struct fun *fun, int s1align, int s2align, int maxlen, int diffpos, in test() argument 75 size_t mte_len = maxlen < len + 1 ? maxlen : len + 1; in test() 78 r = fun->fun (s1, s2, maxlen); in test() 82 if (diffpos >= maxlen) in test() 91 fun->name, s1align, s2align, maxlen, len, diffpos, r); in test()
|
/freebsd/contrib/llvm-project/compiler-rt/lib/sanitizer_common/ |
H A D | sanitizer_libc.cpp | 180 uptr internal_strlcat(char *dst, const char *src, uptr maxlen) { in internal_strlcat() argument 182 const uptr dstlen = internal_strnlen(dst, maxlen); in internal_strlcat() 183 if (dstlen == maxlen) return maxlen + srclen; in internal_strlcat() 184 if (srclen < maxlen - dstlen) { in internal_strlcat() 187 internal_memmove(dst + dstlen, src, maxlen - dstlen - 1); in internal_strlcat() 188 dst[maxlen - 1] = '\0'; in internal_strlcat() 210 uptr internal_strlcpy(char *dst, const char *src, uptr maxlen) { in internal_strlcpy() 212 if (srclen < maxlen) { 214 } else if (maxlen ! in internal_strncpy() 202 internal_strlcpy(char * dst,const char * src,uptr maxlen) internal_strlcpy() argument 221 internal_strnlen(const char * s,uptr maxlen) internal_strnlen() argument 276 internal_wcsnlen(const wchar_t * s,uptr maxlen) internal_wcsnlen() argument [all...] |
/freebsd/contrib/libarchive/libarchive/test/ |
H A D | test_write_format_iso9660_filename.c | 50 size_t maxlen; member 111 assert((length = strlen(pathname)) <= fns->maxlen); in verify_file() 190 assertEqualInt((int)fns->longest_len, (int)fns->maxlen); in verify() 334 fns.maxlen = fns.maxflen = fns.maxelen = 255; in DEFINE_TEST() 340 fns.maxlen = fns.maxflen = fns.maxelen = 64; in DEFINE_TEST() 346 fns.maxlen = 8+3+1; in DEFINE_TEST() 360 fns.maxlen = fns.maxflen = fns.maxelen = 255; in DEFINE_TEST() 366 fns.maxlen = fns.maxflen = fns.maxelen = 64; in DEFINE_TEST() 372 fns.maxlen = 31; in DEFINE_TEST() 386 fns.maxlen = fns.maxflen = fns.maxelen = 255; in DEFINE_TEST() [all …]
|
/freebsd/tools/regression/audit/audit_pipe_ioctl/ |
H A D | audit_pipe_ioctl.c | 46 u_int len, minlen, maxlen; in main() local 70 maxlen = (u_int)(-1); in main() 71 if (ioctl(fd, AUDITPIPE_GET_QLIMIT_MAX, &maxlen) < 0) in main() 73 if (maxlen == (u_int)(-1)) in main() 85 if (!(len <= maxlen)) in main() 102 len = maxlen; in main() 109 if (len != maxlen) in main()
|
/freebsd/bin/ps/ |
H A D | fmt.c | 101 fmt_argv(char **argv, char *cmd, char *thread, size_t maxlen) in fmt_argv() argument 110 len = maxlen + 3; in fmt_argv() 113 len = strlen(ap) + maxlen + 4; in fmt_argv() 121 sprintf(cp, "[%.*s]", (int)maxlen, ap); in fmt_argv() 124 sprintf(cp, "[%.*s]", (int)maxlen, cmd); in fmt_argv() 125 } else if (strncmp(cmdpart(argv[0]), cmd, maxlen) != 0) in fmt_argv() 126 sprintf(cp, "%s (%.*s)", ap, (int)maxlen, cmd); in fmt_argv()
|
/freebsd/contrib/ntp/ntpq/ |
H A D | libntpq.c | 58 int ntpq_stripquotes ( char *resultbuf, char *srcbuf, int datalen, int maxlen ) in ntpq_stripquotes() argument 61 char* dep = resultbuf + maxlen - 1; in ntpq_stripquotes() 67 if (maxlen <= 0) in ntpq_stripquotes() 134 size_t maxlen) in ntpq_getvar() argument 145 ntpq_stripquotes(varvalue, value, strlen(value), maxlen); in ntpq_getvar() 183 int ntpq_queryhost(unsigned short VARSET, unsigned short association, char *resultbuf, int maxlen) in ntpq_queryhost() argument 198 if ( dsize > maxlen) in ntpq_queryhost() 199 dsize = maxlen; in ntpq_queryhost() 587 int ntpq_get_peervar( const char *varname, char *varvalue, int maxlen) in ntpq_get_peervar() argument 589 return ( ntpq_getvar(peervars,peervarlen,varname,varvalue,maxlen) ); in ntpq_get_peervar()
|
H A D | libntpq.h | 86 char *resultbuf, int maxlen); 89 size_t maxlen); 90 extern int ntpq_stripquotes ( char *resultbuf, char *srcbuf, int datalen, int maxlen ); 91 extern int ntpq_queryhost_peervars(associd_t association, char *resultbuf, int maxlen); 92 extern int ntpq_get_peervar( const char *varname, char *varvalue, int maxlen);
|
/freebsd/contrib/netbsd-tests/lib/libcurses/slave/ |
H A D | slave.c | 59 int len, maxlen, argslen, i, ret, type; in process_commands() local 62 len = maxlen = 30; in process_commands() 63 if ((cmdbuf = malloc(maxlen)) == NULL) in process_commands() 76 if ((len + 1) > maxlen) { in process_commands() 77 maxlen = len + 1; in process_commands() 78 if ((tmpbuf = realloc(cmdbuf, maxlen)) == NULL) in process_commands() 80 "bytes failed", maxlen); in process_commands()
|
/freebsd/usr.bin/finger/ |
H A D | lprint.c | 96 int cpr, len, maxlen; in lprint() local 163 for (w = pn->whead, maxlen = -1; w != NULL; w = w->next) in lprint() 164 if ((len = strlen(w->tty)) > maxlen) in lprint() 165 maxlen = len; in lprint() 183 maxlen - (int)strlen(w->tty) + 1, ","); in lprint() 251 int lenthis, maxlen; in demi_print() local 264 maxlen = 5 * TAB_LEN; in demi_print() 265 if (maxlen < lenlast) in demi_print() 266 maxlen = lenlast; in demi_print() 267 if (((((maxlen / TAB_LEN) + 1) * TAB_LEN) + in demi_print()
|
/freebsd/crypto/openssl/apps/lib/ |
H A D | columns.c | 17 int len, maxlen = 0; in calculate_columns() local 21 if ((len = strlen(f->name)) > maxlen) in calculate_columns() 22 maxlen = len; in calculate_columns() 24 dc->width = maxlen + 2; in calculate_columns()
|
/freebsd/usr.bin/patch/ |
H A D | inp.c | 286 size_t i = 0, j, blen = 0, maxlen = 1; in plan_b() local 298 maxlen = 1; in plan_b() 309 if ((size_t)len > maxlen) in plan_b() 310 maxlen = len; /* find longest line */ in plan_b() 339 tireclen = maxlen; in plan_b() 340 tibuflen = maxlen > BUFFERSIZE ? maxlen : BUFFERSIZE; in plan_b() 341 lines_per_buf = tibuflen / maxlen; in plan_b() 349 p = tibuf[0] + maxlen * (i % lines_per_buf); in plan_b() 354 if (fgets(p, maxlen in plan_b() [all...] |
/freebsd/contrib/ncurses/ncurses/tinfo/ |
H A D | make_keys.c | 93 unsigned maxlen = 16; in make_keys() local 108 if (strlen(from) > maxlen) in make_keys() 109 maxlen = (unsigned) strlen(from); in make_keys() 112 (int) maxlen, (int) maxlen, in make_keys()
|
/freebsd/contrib/ncurses/ncurses/base/ |
H A D | lib_getstr.c | 76 int maxlen, in wgetnstr_events() argument 88 T((T_CALLED("wgetnstr(%p,%p,%d)"), (void *) win, (void *) str, maxlen)); in wgetnstr_events() 93 maxlen = _nc_getstr_limit(maxlen); in wgetnstr_events() 146 || (str - oldstr >= maxlen)) { in wgetnstr_events() 214 wgetnstr(WINDOW *win, char *str, int maxlen) in wgetnstr() argument 218 maxlen, in wgetnstr()
|
/freebsd/contrib/flex/src/ |
H A D | scanopt.c | 237 int maxlen[2]; in scanopt_usage() local 241 maxlen[0] = 0; in scanopt_usage() 242 maxlen[1] = 0; in scanopt_usage() 358 if (len > maxlen[0]) in scanopt_usage() 359 maxlen[0] = len; in scanopt_usage() 363 if (len > maxlen[1]) in scanopt_usage() 364 maxlen[1] = len; in scanopt_usage() 370 if (maxlen[0] + maxlen[1] + indent * 2 > columns) { in scanopt_usage() 372 maxlen[1] = columns - (maxlen[0] + indent * 2); in scanopt_usage() 373 if (maxlen[1] < 14) /* 14 is arbitrary lower limit on desc width. */ in scanopt_usage() [all …]
|
/freebsd/sys/dev/usb/net/ |
H A D | if_cdceem.c | 570 int maxlen __diagused, off; in cdceem_send_echo() 576 maxlen = usbd_xfer_max_len(xfer); in cdceem_send_echo() 581 KASSERT(off + sizeof(hdr) + sizeof(CDCEEM_ECHO_PAYLOAD) < maxlen, in cdceem_send_echo() 582 ("%s: out of space; have %d, need %zd", __func__, maxlen, in cdceem_send_echo() 609 int maxlen __diagused, off; in cdceem_send_echo_response() 615 maxlen = usbd_xfer_max_len(xfer); in cdceem_send_echo_response() 617 KASSERT(off + sizeof(hdr) + sc->sc_echo_len < maxlen, in cdceem_send_echo_response() 618 ("%s: out of space; have %d, need %zd", __func__, maxlen, in cdceem_send_echo_response() 649 int maxlen __diagused, off; in cdceem_send_data() 657 maxlen = usbd_xfer_max_len(xfer); in cdceem_send_data() [all …]
|
/freebsd/lib/libc/amd64/string/ |
H A D | strnlen.c | 34 strnlen(const char *s, size_t maxlen) in strnlen() argument 38 loc = __memchr(s, '\0', maxlen); in strnlen() 40 return (loc == NULL ? maxlen : (size_t)(loc - s)); in strnlen()
|
/freebsd/usr.bin/sort/ |
H A D | bwstring.c | 619 size_t i, maxlen; in bwscoll() local 622 maxlen = len1; in bwscoll() 624 if (maxlen > len2) in bwscoll() 625 maxlen = len2; in bwscoll() 627 while (i < maxlen) { in bwscoll() 629 while ((i < maxlen) && in bwscoll() 633 if (i >= maxlen) in bwscoll() 649 while ((i < maxlen) && in bwscoll() 653 if (i >= maxlen) in bwscoll() 678 size_t i, maxlen; in bwscoll() local [all …]
|
/freebsd/sys/contrib/openzfs/module/os/linux/spl/ |
H A D | spl-proc.c | 152 dummy.maxlen = sizeof (str) - 1; in proc_dohostid() 318 .maxlen = sizeof (atomic64_t), 320 .maxlen = sizeof (atomic_t), 328 .maxlen = sizeof (unsigned long), 338 .maxlen = sizeof (unsigned long), 347 .maxlen = sizeof (unsigned long), 356 .maxlen = sizeof (unsigned long), 377 .maxlen = sizeof (ZFS_META_GITREV), 384 .maxlen = sizeof (unsigned long),
|