mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 09:09:03 -04:00
[libsixel] terminate glyph properly #639
This commit is contained in:
parent
e8f115cecb
commit
8b383bbdce
@ -3,20 +3,21 @@
|
||||
#include <sixel/sixel.h>
|
||||
|
||||
typedef struct libsixel_closure {
|
||||
void* buf;
|
||||
char* buf;
|
||||
int size;
|
||||
} libsixel_closure;
|
||||
|
||||
static int
|
||||
libsixel_writer(char* data, int size, void* priv){
|
||||
libsixel_closure* closure = priv;
|
||||
void* tmp = realloc(closure->buf, closure->size + size);
|
||||
char* tmp = realloc(closure->buf, closure->size + size + 1);
|
||||
if(tmp == NULL){
|
||||
return -1;
|
||||
}
|
||||
closure->buf = tmp;
|
||||
memcpy(closure->buf + closure->size, data, size);
|
||||
closure->size += size;
|
||||
closure->buf[closure->size] = '\0';
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user