+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
*
-* Copyright (C) 2008-2009, International Business Machines
+* Copyright (C) 2008-2011, International Business Machines
* Corporation, Google and others. All Rights Reserved.
*
*******************************************************************************
#include "unicode/ucnvsel.h"
+#if !UCONFIG_NO_CONVERSION
+
#include <string.h>
#include "unicode/uchar.h"
}
uprv_memset(mask, ~0, columns *4);
- const UChar *limit;
- if (length >= 0) {
- limit = s + length;
- } else {
- limit = NULL;
- }
-
- while (limit == NULL ? *s != 0 : s != limit) {
- UChar32 c;
- uint16_t pvIndex;
- UTRIE2_U16_NEXT16(sel->trie, s, limit, c, pvIndex);
- if (intersectMasks(mask, sel->pv+pvIndex, columns)) {
- break;
+ if(s!=NULL) {
+ const UChar *limit;
+ if (length >= 0) {
+ limit = s + length;
+ } else {
+ limit = NULL;
+ }
+
+ while (limit == NULL ? *s != 0 : s != limit) {
+ UChar32 c;
+ uint16_t pvIndex;
+ UTRIE2_U16_NEXT16(sel->trie, s, limit, c, pvIndex);
+ if (intersectMasks(mask, sel->pv+pvIndex, columns)) {
+ break;
+ }
}
}
return selectForMask(sel, mask, status);
if (length < 0) {
length = (int32_t)uprv_strlen(s);
}
- const char *limit = s + length;
- while (s != limit) {
- uint16_t pvIndex;
- UTRIE2_U8_NEXT16(sel->trie, s, limit, pvIndex);
- if (intersectMasks(mask, sel->pv+pvIndex, columns)) {
- break;
+ if(s!=NULL) {
+ const char *limit = s + length;
+
+ while (s != limit) {
+ uint16_t pvIndex;
+ UTRIE2_U8_NEXT16(sel->trie, s, limit, pvIndex);
+ if (intersectMasks(mask, sel->pv+pvIndex, columns)) {
+ break;
+ }
}
}
return selectForMask(sel, mask, status);
}
+
+#endif // !UCONFIG_NO_CONVERSION