In case the string to be written by `vsnprintf` including `\0`
termination equals to the length of the buffer, the code enters in a
busy loop. The original code seems to assume, that `vsnprintf` won't
terminate the string with `\0` character which it does.
The [documentation of `vsnprintf`
states](https://en.cppreference.com/w/c/io/vfprintf):
> `int vsnprintf( char *restrict buffer, size_t bufsz, const
> char *restrict format, va_list vlist );`
>
> Writes the results to a character string buffer. At most bufsz - 1
> characters are written. The resulting character string will be
> terminated with a null character, unless bufsz is zero. If bufsz is
> zero, nothing is written and buffer may be a null pointer, [...]
This means that the `size` variable should be set to the total
available length of the buffer, not `length - 1`. Furthermore on the
return value the manual writes:
> however the return value (number of bytes that would be written not
> including the null terminator) is still calculated and returned.
This means that the `written` size returned doesn't count the
terminating `\0` in the length, so the value of `written` can be at
most `size - 1` before truncating the output. In other words a string
having`size = written + 1` would fit exactly in the buffer.
Also as `vsnprintf` will write the terminating `\0` there is no need
to explicitly do that.
* Add support for xz decompression, that will be the base for future
api handling internal implementations and system tools to decompress
buffers in memory.
* Can be used from shell, panels or visual
* Added graph.zoom and graph.mini config variables
* Add r_str_size() api like r_cons_size()
* Add r_cons_pixel_flush()