aboutsummaryrefslogtreecommitdiff
path: root/src/grab.c
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-01-23 02:03:50 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-01-23 02:03:50 +0100
commit16107cd6a31c204d347add809712044666ef688a (patch)
treecef430cdd0cd2e433903dca3d386fa095b2e33f1 /src/grab.c
parent1256660e1f0cea877b6d453704343f07d73d6224 (diff)
Prefer char8_t strings to char strings
Diffstat (limited to 'src/grab.c')
-rw-r--r--src/grab.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/grab.c b/src/grab.c
index 4031540..db9f70c 100644
--- a/src/grab.c
+++ b/src/grab.c
@@ -70,7 +70,7 @@ struct ops {
};
struct sv {
- char *p;
+ char8_t *p;
size_t len;
};
@@ -100,7 +100,7 @@ static bool fflag = GIT_GRAB;
static put_func *putf;
static struct {
- const char *p, *bp;
+ const char8_t *p, *bp;
size_t col, row;
} pos;
@@ -567,7 +567,7 @@ svposcmp(const void *a, const void *b)
void
putm(struct sv sv, struct matches *ms, const char *filename)
{
- const char *p;
+ const char8_t *p;
struct matches valid;
static const char *fn, *hl, *ln, *se;
@@ -640,7 +640,7 @@ putm(struct sv sv, struct matches *ms, const char *filename)
struct u8view v;
size_t len = sv.p - pos.p;
- while (u8gnext(&v, (const char8_t **)&pos.p, &len)) {
+ while (u8gnext(&v, &pos.p, &len)) {
if (islbrk(v)) {
pos.col = 1;
pos.row++;
@@ -731,7 +731,7 @@ putm_nc(struct sv sv, struct matches *ms, const char *filename)
struct u8view v;
size_t len = sv.p - pos.p;
- while (u8gnext(&v, (const char8_t **)&pos.p, &len)) {
+ while (u8gnext(&v, &pos.p, &len)) {
if (islbrk(v)) {
pos.col = 1;
pos.row++;