Home
last modified time | relevance | path

Searched refs:newlen (Results 1 – 25 of 172) sorted by relevance

1234567

/netbsd-src/lib/libc/stdio/
H A Dgetdelim.c61 size_t len, newlen, off; in __weak_alias() local
93 newlen = off + len; in __weak_alias()
95 if (newlen < off || newlen > SSIZE_MAX) { in __weak_alias()
99 newlen++; /* reserve space for the null terminator */ in __weak_alias()
100 if (newlen > *buflen) { in __weak_alias()
101 if (newlen < MINBUF) in __weak_alias()
102 newlen = MINBUF; in __weak_alias()
103 if (!powerof2(newlen)) { in __weak_alias()
105 newlen--; in __weak_alias()
106 newlen |= newlen >> 1; in __weak_alias()
[all …]
/netbsd-src/external/gpl2/groff/dist/src/libs/libgroff/
H A Dstring.cpp31 static char *srealloc(char *ptr, int size, int oldlen, int newlen, int *sizep);
63 static char *srealloc(char *ptr, int oldsz, int oldlen, int newlen, int *sizep) in srealloc() argument
65 if (oldsz >= newlen) { in srealloc()
69 if (newlen == 0) { in srealloc()
75 char *p = new char[*sizep = newlen*2]; in srealloc()
76 if (oldlen < newlen && oldlen != 0) in srealloc()
181 int newlen = len + n; in operator +=() local
182 if (newlen > sz) in operator +=()
183 ptr = srealloc(ptr, sz, len, newlen, &sz); in operator +=()
185 len = newlen; in operator +=()
[all …]
/netbsd-src/external/bsd/dhcpcd/dist/src/
H A Dprivsep-bsd.c194 size_t newlen; in ps_root_dosysctl() local
220 if (p + sizeof(newlen) > e) { in ps_root_dosysctl()
224 memcpy(&newlen, p, sizeof(newlen)); in ps_root_dosysctl()
225 p += sizeof(newlen); in ps_root_dosysctl()
226 if (p + newlen > e) { in ps_root_dosysctl()
230 newp = newlen ? p : NULL; in ps_root_dosysctl()
248 err = sysctl(name, namelen, oldp, oldlenp, newp, newlen); in ps_root_dosysctl()
372 void *oldp, size_t *oldlenp, const void *newp, size_t newlen) in ps_root_sysctl() argument
380 sizeof(newlen) + newlen > sizeof(buf)) in ps_root_sysctl()
396 memcpy(p, &newlen, sizeof(newlen)); in ps_root_sysctl()
[all …]
/netbsd-src/sys/external/bsd/libfdt/dist/
H A Dfdt_rw.c54 static int fdt_splice_(void *fdt, void *splicepoint, int oldlen, int newlen) in fdt_splice_() argument
61 if ((p < (char *)fdt) || ((end - oldlen + newlen) < (char *)fdt)) in fdt_splice_()
63 if ((end - oldlen + newlen) > ((char *)fdt + fdt_totalsize(fdt))) in fdt_splice_()
65 memmove(p + newlen, p + oldlen, end - p - oldlen); in fdt_splice_()
83 int oldlen, int newlen) in fdt_splice_struct_() argument
85 int delta = newlen - oldlen; in fdt_splice_struct_()
88 if ((err = fdt_splice_(fdt, p, oldlen, newlen))) in fdt_splice_struct_()
99 int newlen = strlen(s) + 1; in fdt_del_last_string_() local
101 fdt_set_size_dt_strings(fdt, fdt_size_dt_strings(fdt) - newlen); in fdt_del_last_string_()
104 static int fdt_splice_string_(void *fdt, int newlen) in fdt_splice_string_() argument
[all …]
/netbsd-src/sys/compat/freebsd/
H A Dfreebsd_sysctl.c93 size_t newlen, *oldlenp, oldlen; in freebsd_sys_sysctl() local
137 newlen = SCARG(uap, newlen); in freebsd_sys_sysctl()
138 if (new == NULL || newlen < 1 || in freebsd_sys_sysctl()
139 newlen > (SYSCTL_NAMELEN * CTL_MAXNAME)) in freebsd_sys_sysctl()
153 (char *) malloc(newlen + 1, M_TEMP, M_WAITOK)) == NULL) in freebsd_sys_sysctl()
156 if ((error = copyinstr(new, locnew, newlen + 1, NULL))) { in freebsd_sys_sysctl()
161 ktrmibio(-1, UIO_WRITE, new, newlen + 1, error); in freebsd_sys_sysctl()
/netbsd-src/sys/dev/
H A Ddev_verbose.c44 size_t newlen; in dev_untokenstring() local
48 newlen = strlcat(buf, words + *token, len - 2); in dev_untokenstring()
49 if (newlen > len - 2) in dev_untokenstring()
50 newlen = len - 2; in dev_untokenstring()
51 cp = buf + newlen; in dev_untokenstring()
/netbsd-src/external/gpl3/gcc.old/dist/libphobos/src/std/internal/
H A Dcstring.d170 size_t newlen = res.length * 3 / 2; in trustedRealloc() local
171 if (newlen <= strLength) in trustedRealloc()
172 newlen = strLength + 1; // +1 for terminating 0 in trustedRealloc()
173 auto ptr = cast(To*) malloc(newlen * To.sizeof); in trustedRealloc()
177 return ptr[0 .. newlen]; in trustedRealloc()
183 const newlen = buf.length * 3 / 2; in trustedRealloc() local
184 auto ptr = cast(To*) realloc(buf.ptr, newlen * To.sizeof); in trustedRealloc()
187 return ptr[0 .. newlen]; in trustedRealloc()
H A Dscopebuffer.d181 const newlen = used + s.length; in put() local
184 if (newlen > len) in put()
187 resize(newlen <= len * 2 ? len * 2 : newlen); in put()
189 buf[used .. newlen] = s[]; in put()
190 used = cast(uint) newlen; in put()
/netbsd-src/crypto/external/bsd/openssl/dist/crypto/rand/
H A Drand_pool.c210 size_t newlen = pool->alloc_len; in rand_pool_grow() local
218 newlen = newlen < limit ? newlen * 2 : pool->max_len; in rand_pool_grow()
219 while (len > newlen - pool->len); in rand_pool_grow()
222 p = OPENSSL_secure_zalloc(newlen); in rand_pool_grow()
224 p = OPENSSL_zalloc(newlen); in rand_pool_grow()
235 pool->alloc_len = newlen; in rand_pool_grow()
/netbsd-src/external/gpl3/gcc/dist/libphobos/src/std/internal/
H A Dcstring.d281 const size_t newlen = buf.length * 3 / 2; in trustedRealloc() local
294 auto ptr = cast(To*) enforceRealloc(buf.ptr, newlen * To.sizeof); in trustedRealloc()
295 return ptr[0 .. newlen]; in trustedRealloc()
306 size_t newlen = buf.length * 3 / 2; in trustedReallocStack() local
307 if (newlen <= strLength) in trustedReallocStack()
308 newlen = strLength + 1; // +1 for terminating 0 in trustedReallocStack()
309 auto ptr = cast(To*) enforceMalloc(newlen * To.sizeof); in trustedReallocStack()
311 return ptr[0 .. newlen]; in trustedReallocStack()
H A Dscopebuffer.d182 const newlen = used + s.length; in put() local
185 if (newlen > len) in put()
188 resize(newlen <= len * 2 ? len * 2 : newlen); in put()
190 buf[used .. newlen] = s[]; in put()
191 used = cast(uint) newlen; in put()
/netbsd-src/external/bsd/flex/dist/src/
H A Decs.c40 int i, ich, newlen, cclp, ccls, cclmec; in ccl2ecl() local
50 newlen = 0; in ccl2ecl()
59 ccltbl[cclp + newlen] = (unsigned char) cclmec; in ccl2ecl()
60 ++newlen; in ccl2ecl()
64 ccllen[i] = newlen; in ccl2ecl()
/netbsd-src/lib/libc/gen/
H A Dsysctl.c75 const void *newp, size_t newlen) in sysctl() argument
82 newp, newlen)); in sysctl()
86 error = user_sysctl(name + 1, namelen - 1, oldp, &oldlen, newp, newlen); in sysctl()
107 const void *newp, size_t newlen) in user_sysctl() argument
259 newlen == sizeof(struct sysctlnode)) in user_sysctl()
283 newlen != sizeof(struct sysctlnode))) in user_sysctl()
323 if (newp != NULL || newlen != 0) in user_sysctl()
/netbsd-src/bin/sh/
H A Dmemalloc.c222 int newlen = SHELL_ALIGN(stacknleft * 2 + 100); in growstackblock() local
234 sizeof(struct stack_block) - MINSIZE + newlen); in growstackblock()
238 sstrnleft += newlen - stacknleft; in growstackblock()
239 stacknleft = newlen; in growstackblock()
256 char *p = stalloc(newlen); in growstackblock()
260 stacknleft += newlen; /* we just allocated */ in growstackblock()
/netbsd-src/sys/dev/std/
H A Dieee1212.c88 u_int32_t newlen, offset, test; in p1212_iscomplete() local
136 newlen = 0; in p1212_iscomplete()
145 newlen = P1212_DIRENT_GET_LEN((ntohl(t[offset]))); in p1212_iscomplete()
146 if ((offset + newlen + 1) > *size) { in p1212_iscomplete()
147 newlen += offset + 1; in p1212_iscomplete()
151 if (newlen == 0) { in p1212_iscomplete()
164 len = newlen; in p1212_iscomplete()
165 newlen = 0; in p1212_iscomplete()
183 if ((test > *size) && (test > newlen)) { in p1212_iscomplete()
184 newlen = test; in p1212_iscomplete()
[all …]
/netbsd-src/external/gpl2/texinfo/dist/makeinfo/
H A Dhtml.c347 int i = 0, newlen = 0; in escape_string() local
355 newlen += 6; /* `&quot;' */ in escape_string()
358 newlen += 5; /* `&amp;' */ in escape_string()
362 newlen += 4; /* `&lt;', `&gt;' */ in escape_string()
365 newlen++; in escape_string()
370 if (newlen == i) return string; /* Already OK. */ in escape_string()
372 newstring = xmalloc (newlen); in escape_string()
401 return newstring - newlen; in escape_string()
/netbsd-src/external/gpl2/texinfo/dist/info/
H A Dnodemenu.c168 register int j, newlen; in get_visited_nodes() local
174 for (i = 0, newlen = 1; i < lines_index - 1; i++) in get_visited_nodes()
184 newlen++; in get_visited_nodes()
189 temp = (char **)xmalloc ((1 + newlen) * sizeof (char *)); in get_visited_nodes()
197 lines_index = newlen; in get_visited_nodes()
/netbsd-src/crypto/external/bsd/openssl.old/dist/ssl/
H A Dpacket.c50 size_t newlen; in WPACKET_reserve_bytes() local
56 newlen = SIZE_MAX; in WPACKET_reserve_bytes()
58 newlen = reflen * 2; in WPACKET_reserve_bytes()
59 if (newlen < DEFAULT_BUF_SIZE) in WPACKET_reserve_bytes()
60 newlen = DEFAULT_BUF_SIZE; in WPACKET_reserve_bytes()
62 if (BUF_MEM_grow(pkt->buf, newlen) == 0) in WPACKET_reserve_bytes()
/netbsd-src/usr.bin/grep/
H A Dfile.c134 grep_lnbufgrow(size_t newlen) in grep_lnbufgrow()
137 if (lnbuflen < newlen) { in grep_lnbufgrow()
138 lnbuf = grep_realloc(lnbuf, newlen); in grep_lnbufgrow()
139 lnbuflen = newlen; in grep_lnbufgrow()
132 grep_lnbufgrow(size_t newlen) grep_lnbufgrow() argument
/netbsd-src/external/lgpl3/gmp/dist/printf/
H A Ddoprntf.c64 int prec, ndigits, free_size, len, newlen, justify, justlen, explen; in __gmp_doprnt_mpf() local
152 newlen = exp + prec; in __gmp_doprnt_mpf()
153 if (newlen < 0) in __gmp_doprnt_mpf()
160 else if (len <= newlen) in __gmp_doprnt_mpf()
176 len = newlen; in __gmp_doprnt_mpf()
/netbsd-src/external/gpl3/gdb.old/dist/readline/readline/
H A Dhistory.c406 size_t newlen, curlen, minlen; in _hs_append_history_line() local
414 newlen = 512; /* now realloc in powers of 2 */ in _hs_append_history_line()
416 while (newlen < minlen) in _hs_append_history_line()
417 newlen <<= 1; in _hs_append_history_line()
420 newlen = minlen; in _hs_append_history_line()
423 newline = realloc (hent->line, newlen); in _hs_append_history_line()
/netbsd-src/external/gpl3/gdb/dist/readline/readline/
H A Dhistory.c406 size_t newlen, curlen, minlen; in _hs_append_history_line() local
414 newlen = 512; /* now realloc in powers of 2 */ in _hs_append_history_line()
416 while (newlen < minlen) in _hs_append_history_line()
417 newlen <<= 1; in _hs_append_history_line()
420 newlen = minlen; in _hs_append_history_line()
423 newline = realloc (hent->line, newlen); in _hs_append_history_line()
/netbsd-src/lib/libc/regex/
H A Dregcomp.c2008 sopno newlen;
2033 newlen = 0;
2041 if (newlen == 0) { /* new sequence */
2050 newlen += (sopno)clen;
2052 newlen++;
2085 if (newlen > (sopno)g->mlen) { /* ends one */
2087 g->mlen = newlen;
2090 offset = newlen;
2095 offset += newlen;
2097 newlen
2009 sopno newlen; global() local
[all...]
/netbsd-src/crypto/external/bsd/openssl/dist/crypto/
H A Dpacket.c53 size_t newlen; in WPACKET_reserve_bytes() local
59 newlen = SIZE_MAX; in WPACKET_reserve_bytes()
61 newlen = reflen * 2; in WPACKET_reserve_bytes()
62 if (newlen < DEFAULT_BUF_SIZE) in WPACKET_reserve_bytes()
63 newlen = DEFAULT_BUF_SIZE; in WPACKET_reserve_bytes()
65 if (BUF_MEM_grow(pkt->buf, newlen) == 0) in WPACKET_reserve_bytes()
/netbsd-src/external/bsd/atf/dist/atf-c/detail/
H A Ddynstr.c78 size_t newlen; in prepend_or_append() local
86 newlen = ad->m_length + strlen(aux); in prepend_or_append()
88 if (newlen + sizeof(char) > ad->m_datasize) { in prepend_or_append()
89 err = resize(ad, newlen + sizeof(char)); in prepend_or_append()
99 ad->m_length = newlen; in prepend_or_append()

1234567