From: Haritha D via GitGitGadget Date: Mon, 13 Nov 2023 10:24:10 GMT Subject: [PATCH 08/13] platform_name fix Handled git pipeline errors Message-ID: <9fb74d92e3f5b7209478c8040312277cc27431c1.1699871056.git.gitgitgadget@gmail.com> In-Reply-To: From: Haritha D This PR has fixes to enable build on z/OS Signed-off-by: Harithamma D --- 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