From 0a13c9e9defc771d8b101672f018b1b2de6b9e0e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 10 Dec 2015 08:17:18 -0800 Subject: Split large string section; add truncation advice * manual/examples/strncat.c: Remove. This example was misleading, as the code would have undefined behavior if "hello" was longer than SIZE. Anyway, the manual shouldn't encourage strncpy+strncat for this sort of thing. * manual/string.texi (Copying Strings and Arrays): Split into three sections Copying Strings and Arrays, Concatenating Strings, and Truncating Strings, as this section was way too long. All cross-referenced changed. Add advice about string-truncation functions. Remove misleading strncat example. --- manual/stdio.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manual/stdio.texi') diff --git a/manual/stdio.texi b/manual/stdio.texi index c0753b19cd..0326f29eae 100644 --- a/manual/stdio.texi +++ b/manual/stdio.texi @@ -2428,7 +2428,7 @@ the array @var{s}, not including the terminating null character. The behavior of this function is undefined if copying takes place between objects that overlap---for example, if @var{s} is also given as an argument to be printed under control of the @samp{%s} conversion. -@xref{Copying and Concatenation}. +@xref{Copying Strings and Arrays}. @strong{Warning:} The @code{sprintf} function can be @strong{dangerous} because it can potentially output more characters than can fit in the -- cgit v1.2.1