dbcs_ptr2len(char_u *p)
{
    int		len;

    if (*p == NUL)
	return 0;

    // if the second byte is missing the length is 1
    len = MB_BYTE2LEN(*p);
    if (len == 2 && p[1] == NUL)
	len = 1;
    return len;
}
dbcs_ptr2len(char_u *p)
{
    int		len;

    if (*p == NUL)
	return 0;

     
    len = MB_BYTE2LEN(*p);
    if (len == 2 && p[1] == NUL)
	len = 1;
    return len;
}