1
0
mirror of git://jb55.com/damus synced 2024-09-05 21:03:51 +00:00

cursor: add cursor_memset

This commit is contained in:
William Casarin 2023-12-02 13:41:19 -08:00
parent 7a5aef94a8
commit 27905d24b4

View File

@ -673,4 +673,17 @@ static inline int consume_until_non_alphanumeric(struct cursor *cur, int or_end)
return or_end;
}
static inline int cursor_memset(struct cursor *cursor, unsigned char c, int n)
{
if (cursor->p + n >= cursor->end)
return 0;
memset(cursor->p, c, n);
cursor->p += n;
return 1;
}
#endif