Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixing a reference-out-of-bounds exception in case of "list" command and lots of whitelisted users (max: 100 users * 16 chars = 1600 with buffer being of size 255)
showcasing:
STRING ... WITH POINTER
(that would also never write out of bounds and would allow an easyON OVERFLOW EXIT PERFORM
)EVALUATE
statement, includingALSO
Warning: the initial reason was showcasing this use of
EVALUATE
, followed by recognition of better usingSTRING WITH POINTER
, then realizing a not unlikely exception (first fixed by thatON OVERFLOW
), then thinking about showcasing dynamic memory...This PR is: totally untested (just checked that it compiles with GC 3.1, which needed some adjustments how
ALLOCATE
+FREE
are used) and GC 3.2 and additional needs #294 to be merged up-front (if not wanted aMOVE SPACES TO DYN-BUFFER (BUFFER-POS:)
instead of thatSUBTRACT
to get the length would be possible).As noted this was mostly about showcasing those more rare used COBOL language features, feel free to pick only parts and/or adjust if others fall in the "less clear" or even "unmaintainable" state. The thing that likely should get in is the
STRING
(withON OVERFLOW
if the dynamic memory part is not used.