Skip to content

Commit dc8b1e9

Browse files
committed
Address review comment: clarify realloc_and_append str_to_add=NULL behavior
When _no_user_buf is false and str_to_add is NULL, the function is a no-op returning buf unchanged; "ensure space" only applies in library-managed mode.
1 parent bf0b418 commit dc8b1e9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

hl/src/H5LT.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1919,7 +1919,9 @@ H5LTtext_to_dtype(const char *text, H5LT_lang_t lang_type)
19191919
* - false: User-provided buffer (fixed size, no realloc)
19201920
* len: Pointer to current buffer size (updated if reallocated)
19211921
* buf: Buffer to append to (must not be NULL)
1922-
* str_to_add: String to append (NULL = no append, just ensure space)
1922+
* str_to_add: String to append. If NULL:
1923+
* - Library-managed mode: reallocates to ensure extra space, no append
1924+
* - User-provided mode: no-op, returns buf unchanged (space cannot be ensured)
19231925
*
19241926
* Preconditions:
19251927
* - buf must be a valid, allocated buffer (never NULL)

0 commit comments

Comments
 (0)