summaryrefslogtreecommitdiff
path: root/src/lib9/utf/utfnlen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib9/utf/utfnlen.c')
-rw-r--r--src/lib9/utf/utfnlen.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib9/utf/utfnlen.c b/src/lib9/utf/utfnlen.c
index d673c8290..d6ef5fa06 100644
--- a/src/lib9/utf/utfnlen.c
+++ b/src/lib9/utf/utfnlen.c
@@ -11,8 +11,6 @@
* REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/
-#include <stdarg.h>
-#include <string.h>
#include "utf.h"
#include "utfdef.h"
@@ -20,7 +18,7 @@ int
utfnlen(const char *s, long m)
{
int c;
- long n;
+ int n;
Rune rune;
const char *es;
@@ -33,7 +31,7 @@ utfnlen(const char *s, long m)
s++;
continue;
}
- if(!fullrune(s, es-s))
+ if(!fullrune(s, (int)(es-s)))
break;
s += chartorune(&rune, s);
}