Commit 39b0a871d6078d7c51337bb67d10e251cdab7be8

Bruno Haible 2025-02-09T16:56:39

string-buffer, string-buffer-reversed: Make OOM handling consistent. * lib/string-buffer.h (struct string_buffer): New field 'oom'. * lib/string-buffer.c (sb_init): Initialize the 'oom' field. (sb_append1, sb_append_desc, sb_append_c): Upon out-of-memory, set buffer->oom, not buffer->error. (sb_dupfree, sb_dupfree_c): If there was an OOM, return NULL. * lib/string-buffer-printf.c (sb_appendvf, sb_appendf): Upon out-of-memory, set buffer->oom, not buffer->error. * lib/string-buffer-reversed.h (struct string_buffer_reversed): New field 'oom'. * lib/string-buffer-reversed.c (sbr_init): Initialize the 'oom' field. (sbr_prepend1, sbr_prepend_desc, sbr_prepend_c): Upon out-of-memory, set buffer->oom, not buffer->error. (sbr_dupfree, sbr_dupfree_c): If there was an OOM, return NULL. * lib/string-buffer-reversed-printf.c (sbr_prependvf, sbr_prependf): Upon out-of-memory, set buffer->oom, not buffer->error.