summaryrefslogtreecommitdiff
path: root/lib/libc/string
AgeCommit message (Collapse)Author
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
2013-06-05Use the fancy .In macro for includes. From Jan Klemkow. ok jmc schwarzeTed Unangst
2013-06-04remove some incredible lies about overlapping buffersTheo de Raadt
ok guenther
2013-06-01Fix catopen(3) for UTF-8 locales and update the implementation to POSIX-2008.Stefan Sperling
Catalogs had an arbitrary character set which was used regardless of locale. Add UTF-8-encoded catalogs for libc error messages, and rename existing ones to indicate their character sets. catopen(3) now chooses a catalog which matches the locale's encoding, if available. help & ok matthew, man page bits ok jmc, input from naddy and bluhm
2013-05-30Remove useless include.Antoine Jacoutot
ok millert@
2013-05-15typo: compare len against null needle, not haystackAntoine Jacoutot
from Alf Schlichting ok millert@
2013-05-13Add an implementation of memmem() -- from FreeBSD with some tweaks.Antoine Jacoutot
Requires a libc minor bump, committing now so that we have up-to-date snapshots for the upcoming hackathon. joint work with millert@ man page bits ok jmc@ input and ok millert@, guenther@, deraadt@
2012-08-02remove leftover NOLINT, WANTLINT, LINTFLAGS, LOBJ vars and lint targets.Okan Demirmen
ok guenther@
2012-07-11fix an off-by-one error where the return value would point to theChristian Weisgerber
character after the '\0'; ok guenther@
2012-04-26Add strnlen() to libkern.Matthew Dempsky
ok deraadt
2012-04-03tweak previous;Jason McIntyre
2012-04-02simplify the strlcpy/strlcat manual page substantially. do lessTheo de Raadt
explaining of "what a C string is", and make it more clear that these functiosn BEHAVE EXACTLY LIKE snprintf with "%s"! (anyone who wants to write a 'strlcpy considered harmful' paper should probably write a 'strlcpy and snprintf considered harmful' paper instead). note to those from other projects reading this commit message: It would be very good if this new manual was picked up in your project. ok jmc millert krw
2012-03-26Bump standards years, as we conform to the new versions tooPhilip Guenthe
ok jmc@
2012-03-26strsignal() was standardized in POSIX-2008Philip Guenthe
ok millert@
2012-01-17fix SEE ALSO;Jason McIntyre
2012-01-17Add stpcpy() and stpncpy(), pointless crap that made it into POSIX.Philip Guenthe
Includes friendly linker warning to wake up those dumb enough to use it. Committing for kettenis@, who ran away to the hills after writing it
2012-01-14grammar;Jason McIntyre
2012-01-14this is sparta^WPOSIX 2008Marc Espie
okay millert@
2011-12-08strdup and strndup both use malloc. Make this fact explicit.lum
ok jmc@