segment: Fix implementation of is_all_spaces().
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 30 May 2021 20:30:10 +0000 (13:30 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 30 May 2021 20:31:45 +0000 (13:31 -0700)
src/language/lexer/segment.c

index 8d17ce38fe56b4de73d05b764c652a9d9a040594..1a8e8a6b5fb54c479ba988855777aaf3834b0432 100644 (file)
@@ -227,7 +227,7 @@ is_all_spaces (const char *input_, size_t n)
   for (int ofs = 0; ofs < n; ofs += mblen)
     {
       ucs4_t uc;
-      mblen = u8_mbtouc (&uc, input, n);
+      mblen = u8_mbtouc (&uc, input + ofs, n - ofs);
       if (!lex_uc_is_space (uc))
         return false;
     }