u3: updates u3i_slab implementation to normalize zero-length allocations to 1

This commit is contained in:
Joe Bryan 2020-09-29 12:55:06 -07:00
parent e189aa13a6
commit 54d7b85cab

View File

@ -119,7 +119,7 @@ u3i_slab_bare(u3i_slab* sab_u, c3_g met_g, c3_d len_d)
// if we only need one word, use the static storage in [sab_u]
//
if ( 1 == wor_w ) {
if ( (0 == wor_w) || (1 == wor_w) ) {
sab_u->_._vat_u = 0;
sab_u->buf_w = &sab_u->_._sat_w;
sab_u->len_w = 1;