[PATCH 09/13] strncpy fix Handled git pipeline errors
From: Haritha D <harithamma.d@ibm.com>
This PR has fixes to enable build on z/OS
Signed-off-by: Harithamma D <harithamma.d@ibm.com>
---
convert.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/convert.c b/convert.c
index 9cd0c1382ac..78403de422d 100644
--- a/convert.c
+++ b/convert.c
@@ -1326,7 +1326,13 @@ static const char* get_platform(void) {
{
int index=0;
result = (char *)malloc(strlen(uname_info.sysname)+1);
- strncpy(result, uname_info.sysname, strlen(uname_info.sysname));
+ while(index <= strlen(uname_info.sysname))
+ {
+ *result = uname_info.sysname[index];
+ ++result;
+ ++index;
+ }
+ *result = '\0';
}
#endif
--
gitgitgadget