Various enhancements for zopen tools#58
Conversation
| if (ccsid == 1047 && len == cnt) { | ||
| if (no_tag_read_behaviour == __NO_TAG_READ_DEFAULT_WITHWARNING) { | ||
| if (name) { | ||
| len = strlen(name) + 1; |
There was a problem hiding this comment.
minor thing but i would typically have len be the strlen and then allocate the buffer to len+1 since you don't need to convert a 0 to a 0.
But perhaps just me.
| return 1; | ||
| } | ||
| } // cnt > 8 | ||
| fdcache.set_attribute(fd, 0x0000000000020000UL); |
There was a problem hiding this comment.
use a name for the magic number?
| size_t pos = 0; | ||
|
|
||
| if (*lineptr == NULL || *n == 0) { | ||
| *n = 128; |
There was a problem hiding this comment.
why 128? and why 2 farther down? would those be good to have as buffer length and growth size macros (assuming that's what they are?)
| int c; | ||
|
|
||
| if (buf == NULL || bufsize == 0) { | ||
| bufsize = 128; |
There was a problem hiding this comment.
same comment as above.
MikeFultonDev
left a comment
There was a problem hiding this comment.
reviewed - minor comments.
|
Added a readlink override to address zopencommunity/coreutilsport#74 and zopencommunity/gitport#122 |
| *lineptr = (char *)malloc(*n); | ||
| if (*lineptr == NULL || *n == 0) { | ||
| *n = 120; | ||
| *lineptr = (char *)realloc(*lineptr, *n); |
There was a problem hiding this comment.
Calling realloc() this way is incorrect. If the memory allocation fails, then the original value of lineptr is lost, and the memory it pointed to is leaked. cppcheck complains about this, and suggests you use a temporary pointer to hold the return value, and then assign it to lineptr after validation.
https://stackoverflow.com/questions/21006707/proper-usage-of-realloc
- Override pthread_create to always set autocvt=on - Modify untagged heuristic to remove restriction on min required bytes (8) - Add tests
5bbcd18 to
b0cd547
Compare
* fix: fdopendir and statfs conflict override * feat: strerror without EDC prefix * fix: get rid of fdopendir * fix: get rid of _Packed (maintenance) * refactor: igor - make changes consistent with zoslib * fix: strerror not working due to linker * Update include/zos-v2r5-symbolfixes.h Co-authored-by: Igor Todorovski <39890068+IgorTodorovskiIBM@users.noreply.github.com> * Update include/dirent.h Co-authored-by: Igor Todorovski <39890068+IgorTodorovskiIBM@users.noreply.github.com> * document statfs override --------- Co-authored-by: Igor Todorovski <39890068+IgorTodorovskiIBM@users.noreply.github.com>
* feat: aligned operator new and delete * add todo
* Add initial implementation of ptrace and tests * Guard clock_gettime and nanosleep in time.h to fix build error in zstd * Use _Z_EXPORT in ptrace
* Add error function * Fix various warnings * revert issue * Further updates
* Add mount readonly flag, spawn setsigdefault * Add duplocale. Introduce macro to use zoslib locale
* Add scandir, timegm implementation * Add portable remove_all function * Define FNM_EXTMATCH * Add cpp guard for filesystem header
This commit introduces the `__UNTAGGED_FILE_ENCODING` environment variable, which deprecates `__UNTAGGED_READ_MODE`, to control the handling of untagged files. The implementation prioritizes the new variable, falling back to the old one for compatibility. Documentation and tests have been updated accordingly.
This reverts commit 2b9235e.
Implicit declaration error in gpg - for stpcpy
Uh oh!
There was an error while loading. Please reload this page.