Skip to content

Commit

Permalink
actually fix off-by-one
Browse files Browse the repository at this point in the history
Signed-off-by: Jade Abraham <[email protected]>
  • Loading branch information
jabraham17 committed Dec 6, 2024
1 parent b442d78 commit e4ba41e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runtime/src/chpl-launcher-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ char* chpl_get_enviro_keys(char sep)
int keyLen = strstr(environ[i], "=") - environ[i];

// if the key ends with _modshare, skip it
if (keyLen > 8 && strncmp(environ[i] + keyLen - 8, "_modshare", 9) == 0) {
if (keyLen > 8 && strncmp(environ[i] + keyLen - 9, "_modshare", 9) == 0) {
continue;
}
numVars++;
Expand All @@ -563,7 +563,7 @@ char* chpl_get_enviro_keys(char sep)

int keyLen = strstr(environ[i], "=") - environ[i];
// skip keys that end with _modshare
if (keyLen > 8 && strncmp(environ[i] + keyLen - 8, "_modshare", 9) == 0) {
if (keyLen > 8 && strncmp(environ[i] + keyLen - 9, "_modshare", 9) == 0) {
continue;
}
strncpy(buffer + bufferOffset, environ[i], keyLen);
Expand Down

0 comments on commit e4ba41e

Please sign in to comment.