libc/stream: add base64 encoded stream output

Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
This commit is contained in:
Xu Xingliang
2024-04-09 20:52:51 +08:00
committed by Xiang Xiao
parent 127527acf6
commit 64e3a1fa0b
6 changed files with 222 additions and 6 deletions
+4 -4
View File
@@ -136,8 +136,8 @@ static int hexdumpstream_puts(FAR struct lib_outstream_s *self,
ret = bin2hex(p, ret, stream->buffer + stream->pending,
(outlen - stream->pending) / 2);
p += ret;
remain -= ret;
p += ret;
remain -= ret;
stream->pending += ret * 2;
if (stream->pending == outlen)
@@ -181,6 +181,6 @@ void lib_hexdumpstream(FAR struct lib_hexdumpstream_s *stream,
public->flush = hexdumpstream_flush;
public->nput = 0;
stream->pending = 0;
stream->backend = backend;
stream->pending = 0;
stream->backend = backend;
}