MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlUTF8Strsize

Function xmlUTF8Strsize

ThirdParty/libxml2/vtklibxml2/xmlstring.c:982–1005  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

980 */
981
982int
983xmlUTF8Strsize(const xmlChar *utf, int len) {
984 const xmlChar *ptr=utf;
985 int ch;
986 size_t ret;
987
988 if (utf == NULL)
989 return(0);
990
991 if (len <= 0)
992 return(0);
993
994 while ( len-- > 0) {
995 if ( !*ptr )
996 break;
997 if ( (ch = *ptr++) & 0x80)
998 while ((ch<<=1) & 0x80 ) {
999 if (*ptr == 0) break;
1000 ptr++;
1001 }
1002 }
1003 ret = ptr - utf;
1004 return (ret > INT_MAX ? 0 : ret);
1005}
1006
1007
1008/**

Callers 3

xmlUTF8StrndupFunction · 0.85
xmlUTF8StrlocFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected