Skip to content

Commit

Permalink
Opening binary constants files fix on zOS (#2991)
Browse files Browse the repository at this point in the history
* Using strdup to create tpath before EBCDIC conversion

Signed-off-by: Christopher Munoz <[email protected]>

---------

Signed-off-by: Christopher Munoz <[email protected]>
Co-authored-by: Chris <[email protected]>
  • Loading branch information
christopherlmunoz and Chris authored Nov 5, 2024
1 parent d25c63e commit f935e3d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Runtime/OMExternalConstant.inc
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,11 @@ 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;
#endif
Expand Down

0 comments on commit f935e3d

Please sign in to comment.