This is an automated email from the git hooks/post-receive script.
sparks pushed a commit to branch master
in repository defensive-coding-guide.
commit 876a1bcbd0b2687867aded985d142df5030988ae
Author: Florian Weimer <fweimer(a)redhat.com>
Date: Mon Aug 26 11:43:10 2013 +0200
Correct advice on array allocatoin (#995595)
---
defensive-coding/en-US/C/Allocators.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/defensive-coding/en-US/C/Allocators.xml
b/defensive-coding/en-US/C/Allocators.xml
index e86b37f..1bff610 100644
--- a/defensive-coding/en-US/C/Allocators.xml
+++ b/defensive-coding/en-US/C/Allocators.xml
@@ -135,8 +135,8 @@
is used, the size check must be written manually. For instance,
to allocate an array of <literal>n</literal> elements of type
<literal>T</literal>, check that the requested size is not
- greater than <literal>n / sizeof(T)</literal>. See <xref
- linkend="sect-Defensive_Coding-C-Arithmetic"/>.
+ greater than <literal>((size_t) -1) / sizeof(T)</literal>. See
+ <xref linkend="sect-Defensive_Coding-C-Arithmetic"/>.
</para>
</section>
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date