/* Add a single character to the jwt buffer. Detects overflow, and always keeps the buffer null terminated.  */
static void base64_outch(struct jwt_builder *st, char ch)
/* Add a single character to the jwt buffer. Detects overflow, and always keeps the buffer null terminated.  */
static void base64_outch(struct jwt_builder *st, char ch)
{
	if (st->overflowed) {
		return;
	}
	if (st->len < 2) {
		st->overflowed = true;
		return;
	}
	*st->buf++ = ch;
	st->len--;
	*st->buf = 0;
}