Skip to content

Misc XAlloc cleanup#249

Merged
fasterit merged 2 commits intohtop-dev:masterfrom
cgzones:Xalloc_Cleanup
Oct 20, 2020
Merged

Misc XAlloc cleanup#249
fasterit merged 2 commits intohtop-dev:masterfrom
cgzones:Xalloc_Cleanup

Conversation

@cgzones
Copy link
Copy Markdown
Member

@cgzones cgzones commented Oct 12, 2020

No description provided.

@cgzones cgzones force-pushed the Xalloc_Cleanup branch 2 times, most recently from 2e5ffc8 to b50e8ab Compare October 12, 2020 15:12
@cgzones cgzones marked this pull request as draft October 14, 2020 12:27
@cgzones
Copy link
Copy Markdown
Member Author

cgzones commented Oct 14, 2020

Scheduled after #160 and #161

@cgzones cgzones marked this pull request as ready for review October 19, 2020 13:29
Allocating zero size memory results in implementation-defined behavior:

  man:malloc(3) :
    If size is 0, then malloc() returns either NULL, or a unique pointer
    value that can later be successfully passed to free().
- allow count out-parameter of String_split() to be NULL
- introduce xStrndup()
- do not allow NULL pointers passed to String_eq()
  it is not used in any code
- implement String_startsWith(), String_contains_i() and String_eq()
  as inline header functions
- adjust several conversion issues
Copy link
Copy Markdown
Member

@BenBE BenBE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@fasterit fasterit merged commit 0ea18a6 into htop-dev:master Oct 20, 2020
@cgzones cgzones deleted the Xalloc_Cleanup branch October 20, 2020 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants