Fix compilation issues with strncat
Use remaining buf size as "num" argument instead of bytes to copy.
Change-Id: Ie9a721fdcdde605bcdfa850b47da472db7412362
Signed-off-by: Aushim Nagarkatti <anagarkatti@nvidia.com>
diff --git a/sections/cper-section-nvidia.c b/sections/cper-section-nvidia.c
index c75bf8a..2882ad4 100644
--- a/sections/cper-section-nvidia.c
+++ b/sections/cper-section-nvidia.c
@@ -168,7 +168,8 @@
}
int property_desc_len = strlen(property_desc);
- strncat(*desc_string, property_desc, property_desc_len);
+ strncat(*desc_string, property_desc,
+ SECTION_DESC_STRING_SIZE - strlen(*desc_string) - 1);
// We still want to get as much info as possible, just warn about truncation
if (property_desc_len + strlen(*desc_string) >=
SECTION_DESC_STRING_SIZE) {