summaryrefslogtreecommitdiff
path: root/lib/libc/string
AgeCommit message (Collapse)Author
2016-11-12the referred to EXAMPLES section is now in strncpy(3);Jason McIntyre
issue reported by scott cheloha ok otto
2016-10-19Remove the save_errno dance inside strerror_r(3). It is from theAlexander Bluhm
time when we had national language support. OK millert@
2016-10-16Roll back uintptr_t cast changes after discussions with tedu, otto andDarren Tucker
others. C11 6.5.6.9 says: When two pointers are subtracted, both shall point to elements of the same array object, or one past the last element of the array object; the result is the difference of the subscripts of the two array elements. In these cases the objects are arrays of char so the result is defined, and we believe that the report is based on a compiler incorrectly trapping on defined behaviour.
2016-10-14Cast pointers to uintptr_t to avoid potential signedness errors.Darren Tucker
Based on patch from yuanjie.huang at windriver.com via OpenSSH bz#2608, with & ok millert, ok deraadt.
2016-05-26The destination string is declared as "s" but referred to as "dst"Todd C. Miller
in some cases. Be consistent and use "dst" everywhere like for strlcat(3) and strncat(3). From Tim Kuijsten.
2016-05-11Add RETURN VALUES section and .Xr to memmem(3).Ingo Schwarze
From Michal Mazurek <akfaew at jasminek dot net>. OK tedu@
2016-03-30for some time now mandoc has not required MLINKS to functionJason McIntyre
correctly - logically complete that now by removing MLINKS from base; authors need only to ensure there is an entry in NAME for any function/ util being added. MLINKS will still work, and remain for perl to ease upgrades; ok nicm (curses) bcook (ssl) ok schwarze, who provided a lot of feedback and assistance ok tb natano jung
2015-12-01Phrase allocation failure more clearly. ok deraadt@mmcc
2015-11-24Document that these functions are now in strings.h.Daniel Dickman
ok millert@
2015-10-25The only thing that was translated into multiple languages in OpenBSDAlexander Bluhm
are the errno messages and signal names. Everything else is in English. We are not planning to translate more text. Running a mixed system with less than 1% of the text in native language makes no sense. So remove the NLS support from libc messages. The catopen(3) functions stay as they are. OK stsp@ mpi@
2015-10-01Eliminate the last of the LINTEDn and PRINTFLIKEn comments. In onePhilip Guenther
case, by deleting some useless '& of an array' we also eliminate the need for the casts which prompted the original lint warnings ok deraadt@
2015-09-12__strsignal() is now declared in hidden/signal.hPhilip Guenther
2015-09-12Wrap <inttypes.h> and finish wrapping of <wchar.h> so that calls go directPhilip Guenther
and the symbols not in the C standard are weak
2015-09-06Fix aliasing of sys_errlist, sys_nerr, sys_siglist, and sys_signamePhilip Guenther
to eliminate duplicate copies of the tables and get direct access internally ok kettenis@ deraadt@
2015-09-05Use new framework for wrapping cat{open,gets,close}(), eliminatingPhilip Guenther
_cat* in the process. ok kettenis@
2015-08-31Add framework for resolving (pun intended) libc namespace issues, usingPhilip Guenther
wrapper .h files and asm labels to let internal calls resolve directly and not be overridable or use the PLT. Then, apply that framework to most of the functions in stdio.h, string.h, err.h, and wchar.h. Delete the should-have-been-hidden-all-along _v?(err|warn)[cx]? symbols while here. tests clean on i386, amd64, sparc64, powerpc, and mips64 naming feedback from kettenis@ and millert@ ok kettenis@
2015-06-19Remove needless casts. There's no reason to cast delim to char *Todd C. Miller
when we can just make spanp const char * to match it. OK deraadt@
2015-05-15Make index/rindex weak aliases of strchr/strrchr since they are notTodd C. Miller
part of the ISO C standard and have also been dropped from POSIX. OK guenther@ kettenis@
2015-03-02Update comment to match code; Caspar SchutijserTodd C. Miller
2015-01-15Make strlcpy/strlcat slightly easier to read.Todd C. Miller
2014-12-12catch up with swab.c rev. 1.9:Ingo Schwarze
update SYNOPSIS and DESCRIPTION and add STANDARDS
2014-12-11update swab() to match the current posix definition. "rationale: none."Ted Unangst
rewrite the function to be simpler as well. the compiler can unroll the loop for us if necessary. ok schwarze
2014-12-09no more string(3);Jason McIntyre
2014-12-09In ingo's new world order, we do not want multiple manual pages describingTheo de Raadt
the same thingies. Therefore these "lists of functions" man pages can go away. Hurray! I've wanted these pages to die for around 10 years! ok ingo (and i think jmc)
2014-11-30Replace all 14 instances of .St -ansiC-99 in our tree with .St -isoC-99.Ingo Schwarze
The former is not used anywhere in NetBSD, FreeBSD, or DragonFly and not supported by groff, so i'm going to delete it from mandoc(1). We don't need two macros for the same thing.
2014-11-30restructure libc/string + libc/arch/*/string coperation regardingTheo de Raadt
(potentially) MD versions (function dependent, not filename dependent) split out memcpy/memmove/bcopy and strchr/index/strrchr/rindex Bring back amd64 .S versions And the final touch: switch all architectures temporarily to MI memcpy.c, which contains syslog + abort for overlapping copies. A nice harsh undefined behaviour. We will clean the entire userland of the remaining issues in this catagory, then switch to the optimised memcpy which skips the memmove check. I tried to cut this change into pieces, but testing each sub-step on every architecture is too time consuming and mindnumbing. ok miod
2014-10-11Since deraadt@ remembers seeing strdup() on one particular 4.2BSD machine,Ingo Schwarze
i looked a bit closer and found instances before Reno, so correct HISTORY. References: http://minnie.tuhs.org/cgi-bin/utree.pl?file=4.1cBSD/usr/src/ucb/dbx/defs.h http://minnie.tuhs.org/cgi-bin/utree.pl?file=4.3BSD/usr/src/etc/inetd.c http://minnie.tuhs.org/cgi-bin/utree.pl?file=4.3BSD-Reno/src/lib/libc/string/strdup.c ok deraadt@
2014-10-08obvious malloc -> reallocarray, for mult int oflowTheo de Raadt
2014-07-09rephrase the stpcpy() warningChristian Weisgerber
new wording agreed by at least kettenis@ millert@ otto@
2014-06-21loosen the spec for timingsafe functions slightly, so as to notTed Unangst
artificially constrain alternative implementations. ok deraadt
2014-06-21Protect explicit_bzero() from link-time optimizationMatthew Dempsky
Modern compiler toolchains are capable of optimizing even across translation unit boundaries, so simply moving the memory clearing into a separate function is not guaranteed to clear memory. To avoid this, we take advantage of ELF weak symbol semantics, and insert a call to an empty, weakly named function. The semantics of calling this function aren't determinable until load time, so the compiler and linker need to keep the memset() call. There are still ways a toolchain might defeat this trick (e.g., optimistically expecting the weak symbol to not be overloaded, and only calling memset() if it is; promoting weak symbols to strong symbols at link-time when emitting a static binary because they won't be interposed; implementing load-time optimizations). But at least for the foreseeable future, these seem unlikely. ok deraadt
2014-06-13Add timingsafe_memcmp().Matthew Dempsky
ok deraadt, jmc, tedu
2014-06-10mop up ifndef KERNEL goo; ok miodTheo de Raadt
2014-04-19tweak previous;Jason McIntyre
2014-04-19Use somewhat harsher language and better examples; demonstrate thatTheo de Raadt
non-dangerous use functions is difficult. ok guenther
2014-04-07Add some missing names to the NAME sections.Ingo Schwarze
For inet(3), go the other way, remove some bogus symlinks. Found while testing the new makewhatis(8). ok jmc@
2014-03-23remove the never used bm string functionsTed Unangst
2014-02-23in HISTORY, say where this actually came from;Ingo Schwarze
ok deraadt@ bentley@
2014-02-05Remove unnecessary stdio.h include.Stefan Sperling
Patch by Jean-Philippe Ouellet ; ok krw@
2014-01-22add explicit_bzero to NAME;Jason McIntyre
2014-01-22add explicit_bzero to libc. implementation subject to change, but startTed Unangst
the ball rolling. ok deraadt.
2013-12-19fix double word error;Jason McIntyre
2013-12-19Split out strncpy and strncat from strcpy and strcat manuals.Todd C. Miller
Requested by deraadt@
2013-12-05no more regexp(3), so point to regex(3);Jason McIntyre
as advised by deraadt
2013-10-14Missed the file renames for the string functions when committing thePhilip Guenther
DIST_LIB/DIST_OBJ/*.do changes
2013-09-30Use PATH_MAX, NAME_MAX and LOGIN_NAME_MAX not MAXPATHNAMELEN,Todd C. Miller
MAXNAMLEN or MAXLOGNAME where possible. OK deraadt@
2013-09-25Add examples to show why this is a terrible API. OK jmc@ henning@Todd C. Miller
2013-09-25According to POSIX, if the src and dst strings overlap, the behaviorTodd C. Miller
is undefined. Add a warning to that effect. OK deraadt@ jmc@
2013-07-17more library historyIngo Schwarze
facts checked by sobrado@ style tweaks and ok jmc@
2013-07-16use .Mt for email addresses; from Jan Stary <hans at stare dot cz>; ok jmc@Ingo Schwarze