+/Femto

toy text editor

git clone https://git.julia.blue/+/Femto

Joseph RyanFixup973c5b9

master
270 B11 linesraw
1#include "../inc/abuf.h"
2
3void abappend(abuf* ab, const char* s, int len) {
4    char* new = realloc(ab->b, ab->len + len);
5    if (new == NULL) { return; }
6    memcpy(&new[ab->len], s, len);
7    ab->len += len;
8    ab->b = new;
9}
10
11void abfree(abuf* ab) { free(ab->b); }