Commits

Evan Gates  committed af695f0

ugly

  • Participants
  • Parent commits 7119937
  • Branches utf8

Comments (0)

Files changed (1)

 		(buf[*ind] & 0xc0) != 0xc0 && (buf[*ind] & 0x80);
 		*ind += crement)
 		;
-	if (*ind < 0) {
+	if (*ind == -1) {
 		*ind = 0;
 		return -1;
 	}
+	if (*ind == len) {
+		*ind = len - 1;
+		return -1;
+	}
 	// skip the first, if it's ascii we still want one byte (nb = 1)
 	for (nb = 1, mask = 0x40; buf[*ind] & mask; nb++, mask >>= 1)
 		;