]> git.saurik.com Git - apple/icu.git/blame - icuSources/test/fuzzer/uloc_canonicalize_fuzzer.cc
ICU-64232.0.1.tar.gz
[apple/icu.git] / icuSources / test / fuzzer / uloc_canonicalize_fuzzer.cc
CommitLineData
3d1f044b
A
1// © 2019 and later: Unicode, Inc. and others.
2// License & terms of use: http://www.unicode.org/copyright.html
3
4#include <string>
5
6#include "locale_util.h"
7#include "unicode/uloc.h"
8
9extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
10 // Canonicalized locale name.
11 char name[ULOC_FULLNAME_CAPACITY];
12 int32_t name_capacity = ULOC_FULLNAME_CAPACITY;
13
14 const std::string input = MakeZeroTerminatedInput(data, size);
15
16 UErrorCode status = U_ZERO_ERROR;
17 uloc_canonicalize(input.c_str(), name, name_capacity, &status);
18
19 return 0;
20}