-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trim env var for startup check #395
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,7 +121,12 @@ void abortIfUnsupportedCAA() { | |
#ifndef METTLE | ||
if (zosVersion > LE_MAX_SUPPORTED_ZOS) { | ||
const char *continueWithWarning = getenv("ZWE_zowe_launcher_unsafeDisableZosVersionCheck"); | ||
if (!strcmp(continueWithWarning, "true")) { | ||
/* using STDENV in JCL can result in env values that need trimming... */ | ||
char *trimmed[strlen(continueWithWarning)+1]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you just save the length once and reuse it? size_t valueLen = strlen(continueWithWarning); |
||
strncpy(trimmed, continueWithWarning, strlen(continueWithWarning)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will leave the destination unterminated because |
||
trimRight(trimmed, strlen(trimmed)); | ||
|
||
if (!strcmp(trimmed, "true")) { | ||
printf("warning: z/OS version = 0x%08X, max supported version = 0x%08X - " | ||
"CAA fields require verification\n", zosVersion, LE_MAX_SUPPORTED_ZOS); | ||
} else { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JoeNemo just pointed to a bug here. This shouldn't have
*
.