Message ID | 8fa15ac45f78fbf0fda321a073a1020a471ee479.1699871056.git.gitgitgadget@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Enabling z/OS workflow for git | expand |
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