[PATCH 08/13] platform_name 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 | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/convert.c b/convert.c
index c8d30011458..9cd0c1382ac 100644
--- a/convert.c
+++ b/convert.c
@@ -1321,19 +1321,14 @@ static const char* get_platform(void) {
die(_("uname() failed with error '%s' (%d)\n"),
strerror(errno),
errno);
-
+#ifndef __MVS__
if(*uname_info.sysname != '\0')
{
int index=0;
result = (char *)malloc(strlen(uname_info.sysname)+1);
- while(index <= strlen(uname_info.sysname))
- {
- *result = uname_info.sysname[index];
- ++result;
- ++index;
- }
- *result = '\0';
+ strncpy(result, uname_info.sysname, strlen(uname_info.sysname));
}
+#endif
#ifdef __MVS__
if (!strcmp(uname_info.sysname, "OS/390"))
--
gitgitgadget