Fix compile error by casting sbuf_len() to size_t