mirror of
git://jb55.com/damus
synced 2024-09-16 02:03:45 +00:00
cursor: add cursor_memset
This commit is contained in:
parent
7a5aef94a8
commit
27905d24b4
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user