[PATCH] psxhdrs/strncat: Fix string truncation warning
Aschref Ben-Thabet
aschref.ben-thabet at embedded-brains.de
Thu Jul 30 13:58:18 UTC 2020
From: Aschref Ben Thabet <aschref.ben-thabet at embedded-brains.de>
---
testsuites/psxtests/psxhdrs/string/strncat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testsuites/psxtests/psxhdrs/string/strncat.c b/testsuites/psxtests/psxhdrs/string/strncat.c
index 730a56cfa6..d872be3408 100644
--- a/testsuites/psxtests/psxhdrs/string/strncat.c
+++ b/testsuites/psxtests/psxhdrs/string/strncat.c
@@ -45,7 +45,7 @@
char buffer[SIZE] = "computer";
char *result;
- result = strncat( buffer, " program", 3 );
+ result = strncat( buffer, " program", sizeof( buffer ) - 1 );
return ( result != NULL );
}
--
2.26.2
More information about the devel
mailing list