X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fmbsnlen.c;h=e597d5a2f41e3071dfa814414d46b6d9d94f6200;hb=721f56dcf49f8f004f609cc966f876922faad1a8;hp=fe4e39e6c1f894476984224ad725461474a2f648;hpb=57fdfd3f8ec62b105c53bcdf6f127c35c7fe7391;p=gnulib.git diff --git a/lib/mbsnlen.c b/lib/mbsnlen.c index fe4e39e6c..e597d5a2f 100644 --- a/lib/mbsnlen.c +++ b/lib/mbsnlen.c @@ -1,5 +1,5 @@ /* Counting the multibyte characters in a string. - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007-2011 Free Software Foundation, Inc. Written by Bruno Haible , 2007. This program is free software: you can redistribute it and/or modify @@ -22,16 +22,13 @@ #include -#if HAVE_MBRTOWC -# include "mbiter.h" -#endif +#include "mbiter.h" /* Return the number of multibyte characters in the character string starting at STRING and ending at STRING + LEN. */ size_t mbsnlen (const char *string, size_t len) { -#if HAVE_MBRTOWC if (MB_CUR_MAX > 1) { size_t count; @@ -39,11 +36,10 @@ mbsnlen (const char *string, size_t len) count = 0; for (mbi_init (iter, string, len); mbi_avail (iter); mbi_advance (iter)) - count++; + count++; return count; } else -#endif return len; }