Skip to content

Commit

Permalink
Using strdup to create tpath before EBCDIC conversion
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Munoz <[email protected]>
  • Loading branch information
christopherlmunoz committed Nov 4, 2024
1 parent 82e588d commit 96df033
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Runtime/OMExternalConstant.inc
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,13 @@ void omMMapBinaryFile(
char *fname = filename;
#ifdef __MVS__
// Convert the file name to EBCDIC for the open call.
char *tPath;
size_t tLen = strlen(fname);
tPath = (char *)malloc(tLen);
char *tPath = strdup(fname);
if (!tPath) {
fprintf(stderr, "Error while malloc");
fprintf(stderr, "Error while strdup");
return;
}
memcpy(tPath, fname, tLen);
__a2e_s(tPath);
fname = tPath;
fname[tLen] = '\0';
#endif

if (constAddr == NULL) {
Expand Down

0 comments on commit 96df033

Please sign in to comment.