/* $OpenLDAP$ */
-/*
- * Copyright 2002 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 2002-2011 The OpenLDAP Foundation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
+ */
+/* ACKNOWLEDGEMENTS:
+ * This work was initially developed by Howard Chu for inclusion in
+ * OpenLDAP Software.
*/
/*
/* Invalid T.61 characters? */
if (!t61_tab[*c])
return LDAP_INVALID_SYNTAX;
- if (*c & 0xf0 == 0xc0) {
+ if ((*c & 0xf0) == 0xc0) {
int j = *c & 0x0f;
/* If this is the end of the string, or if the base
* character is just a space, treat this as a regular
return LDAP_NO_MEMORY;
for (i=0,c=(unsigned char *)src->bv_val; i < src->bv_len; c++,i++) {
- if (*c & 0xf0 == 0xc0) {
+ if ((*c & 0xf0) == 0xc0) {
int j = *c & 0x0f;
/* If this is the end of the string, or if the base
* character is just a space, treat this as a regular
*d++ = 0x3f;
break;
}
+ i += j;
+ c += j;
}
*d = '\0';
return LDAP_SUCCESS;