--- mark.c	2025-05-15 08:31:27
+++ mark.c	2026-05-11 15:27:15
@@ -133,17 +133,17 @@
  */
 static int nextchar(int *xp, int *yp, int direction, char target, int num)
 {
-	int width;		/* width of the current window. */
-	int x;			/* x coordinate of the current cursor position. */
-	int step;		/* amount to increment x (+1 or -1) */
-	int adjust;		/* Final adjustment of cursor position. */
-	char *displayed_line;	/* Line in which search takes place. */
+	int width;			/* width of the current window. */
+	int x;				/* x coordinate of the current cursor position. */
+	int step;			/* amount to increment x (+1 or -1) */
+	int adjust;			/* Final adjustment of cursor position. */
+	uint32_t *displayed_line;	/* Line in which search takes place. */
 
 	x = *xp;
 	step = 1;
 	adjust = 0;
 	width = fore->w_width;
-	displayed_line = (char *)WIN(*yp)->image;
+	displayed_line = WIN(*yp)->image;
 
 	switch (direction) {
 	case 't':
@@ -161,7 +161,7 @@
 	x += step;
 
 	for (; x >= 0 && x <= width; x += step) {
-		if (displayed_line[x] == target) {
+		if (displayed_line[x] == (uint32_t)(unsigned char)target) {
 			if (--num == 0) {
 				*xp = x + adjust;
 				return 0;
