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 805f9a85c843413140c867922bc2695cbbd1766a
Author: Florian Weimer <fweimer(a)redhat.com>
Date: Mon Sep 16 15:08:29 2013 +0200
Actually use strncat in the strncat example
Spotted by Thomas Miletich <thomas.miletich(a)gmail.com>.
---
defensive-coding/src/C-String-Functions.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/defensive-coding/src/C-String-Functions.c
b/defensive-coding/src/C-String-Functions.c
index 34d9c31..9f8898a 100644
--- a/defensive-coding/src/C-String-Functions.c
+++ b/defensive-coding/src/C-String-Functions.c
@@ -70,7 +70,7 @@ main(void)
assert(strncmp(buf, data, 9) == 0);
//+ C String-Functions-strncat-as-strncpy
buf[0] = '\0';
- strncpy(buf, data, sizeof(buf) - 1);
+ strncat(buf, data, sizeof(buf) - 1);
//-
}
{
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date