FTXUI 7.0.0
C++ functional terminal UI.
Loading...
Searching...
No Matches
utf8_fuzzer.cpp
Go to the documentation of this file.
1// Copyright 2026 Arthur Sonzogni. All rights reserved.
2// Use of this source code is governed by the MIT license that can be found in
3// the LICENSE file.
4#include <cstddef>
5#include <string>
6#include <string_view>
8
9using namespace ftxui;
10
11extern "C" int LLVMFuzzerTestOneInput(const char* data, size_t size) {
12 std::string_view input(data, size);
13
14 // Fuzz to_wstring
15 try {
16 to_wstring(input);
17 } catch (...) {
18 }
19
20 // Fuzz string_width
21 try {
22 string_width(input);
23 } catch (...) {
24 }
25
26 // Fuzz Utf8ToGlyphs
27 try {
28 Utf8ToGlyphs(input);
29 } catch (...) {
30 }
31
32 // Fuzz CellToGlyphIndex
33 try {
34 CellToGlyphIndex(input);
35 } catch (...) {
36 }
37
38 return 0;
39}
The FTXUI ftxui:: namespace.
Definition animation.hpp:11
FTXUI_EXPORT(SCREEN) int string_width(std std::vector< std::string > Utf8ToGlyphs(std::string_view input)
Definition string.cpp:1387
int string_width(std::string_view input)
Definition string.cpp:1337
std::vector< int > CellToGlyphIndex(std::string_view input)
Definition string.cpp:1494
FTXUI_EXPORT(SCREEN) std FTXUI_EXPORT(SCREEN) std std::wstring to_wstring(T s)
Definition string.hpp:18
int LLVMFuzzerTestOneInput(const char *data, size_t size)