aboutsummaryrefslogtreecommitdiff
path: root/manual
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2023-04-08 13:51:26 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2023-04-08 13:53:22 -0700
commitf173e27272e6e37cab016f9ef3f90d3e1189329f (patch)
tree5436a489f0c43f98877687f7662c1550aa75957f /manual
parent1fb225923a1da5dd54d4e7460ccb7fcd12879982 (diff)
downloadglibc-f173e27272e6e37cab016f9ef3f90d3e1189329f.zip
glibc-f173e27272e6e37cab016f9ef3f90d3e1189329f.tar.gz
glibc-f173e27272e6e37cab016f9ef3f90d3e1189329f.tar.bz2
manual: document snprintf truncation better
Diffstat (limited to 'manual')
-rw-r--r--manual/stdio.texi5
1 files changed, 4 insertions, 1 deletions
diff --git a/manual/stdio.texi b/manual/stdio.texi
index c502a21..3820a24 100644
--- a/manual/stdio.texi
+++ b/manual/stdio.texi
@@ -2439,7 +2439,10 @@ If @var{size} is zero, nothing, not even the null byte, shall be written and
The return value is the number of characters which would be generated
for the given input, excluding the trailing null. If this value is
greater than or equal to @var{size}, not all characters from the result have
-been stored in @var{s}. You should try again with a bigger output
+been stored in @var{s}. If this happens, you should be wary of using
+the truncated result as that could lead to security, encoding, or
+other bugs in your program (@pxref{Truncating Strings}).
+Instead, you should try again with a bigger output
string. Here is an example of doing this:
@smallexample