From 5f1e938fcc9a54a8290c9afd0a1e58ec93971c52 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Mon, 27 Mar 2023 07:33:28 -0500 Subject: [PATCH] Bugfix: The fl_string parsing functions do not check buffer.used. The range length is being performed but not the buffer used length. Add the appropriate return codes to represent end of string (buffer used length is reached). This is applicable for the dynamic strings but is not applicable for the regular strings. Do some code clean up while I am at it. --- level_1/fl_string/c/string.c | 326 +++++++++++++------------------------------ level_1/fl_string/c/string.h | 14 ++ 2 files changed, 110 insertions(+), 230 deletions(-) diff --git a/level_1/fl_string/c/string.c b/level_1/fl_string/c/string.c index 76d16a7..8e0ef3d 100644 --- a/level_1/fl_string/c/string.c +++ b/level_1/fl_string/c/string.c @@ -179,13 +179,8 @@ extern "C" { if (!destination) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (!source.used) { - return F_data_not_eos; - } - - if (range.start > range.stop) { - return F_data_not_stop; - } + if (!source.used) return F_data_not_eos; + if (range.start > range.stop) return F_data_not_stop; f_array_length_t begin = range.start; f_array_length_t end = range.stop; @@ -193,15 +188,10 @@ extern "C" { { const f_status_t status = private_fl_string_rip_find_range(source.string, &begin, &end); if (F_status_is_error(status)) return status; - - if (status == F_data_not) { - return status; - } + if (status == F_data_not) return status; } - if (begin > end) { - return F_data_not_stop; - } + if (begin > end) return F_data_not_stop; return f_string_append(source.string + begin, (end - begin) + 1, destination); } @@ -213,13 +203,8 @@ extern "C" { if (!destination) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (!source.used) { - return F_data_not_eos; - } - - if (range.start > range.stop) { - return F_data_not_stop; - } + if (!source.used) return F_data_not_eos; + if (range.start > range.stop) return F_data_not_stop; f_array_length_t begin = range.start; f_array_length_t end = range.stop; @@ -227,15 +212,10 @@ extern "C" { { const f_status_t status = private_fl_string_rip_find_range(source.string, &begin, &end); if (F_status_is_error(status)) return status; - - if (status == F_data_not) { - return status; - } + if (status == F_data_not) return status; } - if (begin > end) { - return F_data_not_stop; - } + if (begin > end) return F_data_not_stop; return f_string_append_nulless(source.string + begin, (end - begin) + 1, destination); } @@ -247,9 +227,7 @@ extern "C" { if (!destination) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (!source.used) { - return F_data_not_eos; - } + if (!source.used) return F_data_not_eos; f_array_length_t begin = 0; f_array_length_t end = source.used - 1; @@ -257,15 +235,10 @@ extern "C" { { const f_status_t status = private_fl_string_rip_find_range(source.string, &begin, &end); if (F_status_is_error(status)) return status; - - if (status == F_data_not) { - return status; - } + if (status == F_data_not) return status; } - if (begin > end) { - return F_data_not_stop; - } + if (begin > end) return F_data_not_stop; return f_string_append(source.string + begin, (end - begin) + 1, destination); } @@ -277,9 +250,7 @@ extern "C" { if (!destination) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (!source.used) { - return F_data_not_eos; - } + if (!source.used) return F_data_not_eos; f_array_length_t begin = 0; f_array_length_t end = source.used - 1; @@ -287,15 +258,10 @@ extern "C" { { const f_status_t status = private_fl_string_rip_find_range(source.string, &begin, &end); if (F_status_is_error(status)) return status; - - if (status == F_data_not) { - return status; - } + if (status == F_data_not) return status; } - if (begin > end) { - return F_data_not_stop; - } + if (begin > end) return F_data_not_stop; return f_string_append_nulless(source.string + begin, (end - begin) + 1, destination); } @@ -307,13 +273,9 @@ extern "C" { if (!range) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (!buffer.used) { - return F_data_not; - } - - if (range->start > range->stop) { - return F_data_not_stop; - } + if (!buffer.used) return F_data_not; + if (range->start > range->stop) return F_data_not_stop; + if (range->start >= buffer.used) return F_data_not_eos; const unsigned short seek_width = macro_f_utf_char_t_width(seek_to_this); @@ -322,7 +284,7 @@ extern "C" { unsigned short width = 0; f_array_length_t width_max = 0; - while (range->start <= range->stop) { + while (range->start <= range->stop && range->start < buffer.used) { width_max = (range->stop - range->start) + 1; width = macro_f_utf_byte_width_is(buffer.string[range->start]); @@ -330,44 +292,32 @@ extern "C" { if (!width) { width = 1; - if (buffer.string[range->start] == f_string_eol_s.string[0]) { - return F_none_eol; - } - - if (seek_width == width) { - if (buffer.string[range->start] == seek_to_this) { - return F_none; - } - } + if (buffer.string[range->start] == f_string_eol_s.string[0]) return F_none_eol; + if (seek_width == width && buffer.string[range->start] == seek_to_this) return F_none; } // Do not operate on UTF-8 fragments that are not the first byte of the character. else if (width == 1) { return F_status_set_error(F_complete_not_utf); } else { - if (range->start + width > range->stop) { - return F_status_set_error(F_complete_not_utf_stop); - } + if (range->start + width > range->stop) return F_status_set_error(F_complete_not_utf_stop); + if (range->start + width >= buffer.used) return F_status_set_error(F_complete_not_utf_eos); if (width == seek_width) { f_utf_char_t character = 0; status = f_utf_char_to_character(buffer.string + range->start, width_max, &character); if (F_status_is_error(status)) return status; - - if (character == seek_to_this) { - return F_none; - } + if (character == seek_to_this) return F_none; } } range->start += width; - - if (range->start >= range->stop) { - return F_none_stop; - } } // while + if (range->start > range->stop) return F_none_stop; + if (range->start > buffer.range) return F_none_eos; + return F_none_eos; } #endif // _di_fl_string_dynamic_seek_line_to_utf_character_ @@ -378,13 +328,9 @@ extern "C" { if (!range) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (!buffer.used) { - return F_data_not; - } - - if (range->start > range->stop) { - return F_data_not_stop; - } + if (!buffer.used) return F_data_not; + if (range->start > range->stop) return F_data_not_stop; + if (range->start >= buffer.used) return F_data_not_eos; f_status_t status = F_none; unsigned short width = 0; @@ -394,10 +340,7 @@ extern "C" { while (buffer.string[range->start] == placeholder || (status = f_utf_is_graph(buffer.string + range->start, width_max)) == F_false) { if (F_status_is_error(status)) return status; - - if (buffer.string[range->start] == f_string_eol_s.string[0]) { - return F_none_eol; - } + if (buffer.string[range->start] == f_string_eol_s.string[0]) return F_none_eol; width = macro_f_utf_byte_width_is(buffer.string[range->start]); @@ -410,16 +353,14 @@ extern "C" { return F_status_set_error(F_complete_not_utf); } else { - if (range->start + width > range->stop) { - return F_status_set_error(F_complete_not_utf_stop); - } + if (range->start + width > range->stop) return F_status_set_error(F_complete_not_utf_stop); + if (range->start + width >= buffer.used) return F_status_set_error(F_complete_not_utf_eos); } range->start += width; - if (range->start > range->stop) { - return F_none_stop; - } + if (range->start > range->stop) return F_none_stop; + if (range->start >= buffer.used) return F_none_eos; width_max = (range->stop - range->start) + 1; } // while @@ -436,13 +377,9 @@ extern "C" { if (!range) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (!buffer.used) { - return F_data_not; - } - - if (range->start > range->stop) { - return F_data_not_stop; - } + if (!buffer.used) return F_data_not; + if (range->start > range->stop) return F_data_not_stop; + if (range->start >= buffer.used) return F_data_not_eos; f_status_t status = F_none; unsigned short width = 0; @@ -452,10 +389,7 @@ extern "C" { while (buffer.string[range->start] == placeholder || (status = f_utf_is_whitespace(buffer.string + range->start, width_max, F_false)) == F_false) { if (F_status_is_error(status)) return status; - - if (buffer.string[range->start] == f_string_eol_s.string[0]) { - return F_none_eol; - } + if (buffer.string[range->start] == f_string_eol_s.string[0]) return F_none_eol; width = macro_f_utf_byte_width_is(buffer.string[range->start]); @@ -468,16 +402,14 @@ extern "C" { return F_status_set_error(F_complete_not_utf); } else { - if (range->start + width > range->stop) { - return F_status_set_error(F_complete_not_utf_stop); - } + if (range->start + width > range->stop) return F_status_set_error(F_complete_not_utf_stop); + if (range->start + width >= buffer.used) return F_status_set_error(F_complete_not_utf_eos); } range->start += width; - if (range->start > range->stop) { - return F_none_stop; - } + if (range->start > range->stop) return F_none_stop; + if (range->start >= buffer.used) return F_none_eos; width_max = (range->stop - range->start) + 1; } // while @@ -494,13 +426,9 @@ extern "C" { if (!range) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (!buffer.used) { - return F_data_not; - } - - if (range->start > range->stop) { - return F_data_not_stop; - } + if (!buffer.used) return F_data_not; + if (range->start > range->stop) return F_data_not_stop; + if (range->start > buffer.used) return F_data_not_eos; const unsigned short seek_width = macro_f_utf_char_t_width(seek_to_this); @@ -510,7 +438,7 @@ extern "C" { f_array_length_t width_max = 0; - while (range->start <= range->stop) { + while (range->start <= range->stop && range->start < buffer.used) { width_max = (range->stop - range->start) + 1; width = macro_f_utf_byte_width_is(buffer.string[range->start]); @@ -519,9 +447,7 @@ extern "C" { width = 1; if (seek_width == width) { - if (buffer.string[range->start] == seek_to_this) { - return F_none; - } + if (buffer.string[range->start] == seek_to_this) return F_none; } } // Do not operate on UTF-8 fragments that are not the first byte of the character. @@ -529,29 +455,23 @@ extern "C" { return F_status_set_error(F_complete_not_utf); } else { - if (range->start + width > range->stop) { - return F_status_set_error(F_complete_not_utf_stop); - } + if (range->start + width > range->stop) return F_status_set_error(F_complete_not_utf_stop); + if (range->start + width >= buffer.used) return F_status_set_error(F_complete_not_utf_eos); if (width == seek_width) { f_utf_char_t character = 0; status = f_utf_char_to_character(buffer.string + range->start, width_max, &character); if (F_status_is_error(status)) return status; - - if (character == seek_to_this) { - return F_none; - } + if (character == seek_to_this) return F_none; } } range->start += width; - - if (range->start >= range->stop) { - return F_none_stop; - } } // while + if (range->start > range->stop) return F_none_stop; + return F_none_eos; } #endif // _di_fl_string_dynamic_seek_to_utf_character_ @@ -568,19 +488,18 @@ extern "C" { } // Skip past all leading NULLs. - for (; range->start <= range->stop; ++range->start) { + for (; range->start <= range->stop && range->start < buffer.used; ++range->start) { if (buffer.string[range->start]) break; } // for - if (range->start > range->stop) { - return F_data_not; - } + if (range->start > range->stop) return F_data_not_stop; + if (range->start > range->stop) return F_data_not_eos; // The FLL Identifier is always at least 6 characters ("X-0000"). if (range->stop - range->start < 5) { // Increment until stop, while taking into consideration UTF-8 character widths. - for (; range->start <= range->stop; ) { + for (; range->start <= range->stop && range->start < buffer.used; ) { if (buffer.string[range->start] == f_string_eol_s.string[0]) { ++range->start; @@ -596,14 +515,12 @@ extern "C" { f_status_t status = F_none; - for (; range->start <= range->stop; ) { + for (; range->start <= range->stop && range->start < buffer.used; ) { status = f_utf_is_whitespace(buffer.string + range->start, (range->stop - range->start) + 1, F_false); if (F_status_is_error(status)) { - if (F_status_set_fine(status) == F_maybe) { - return F_status_set_error(F_complete_not_utf); - } + if (F_status_set_fine(status) == F_maybe) return F_status_set_error(F_complete_not_utf); return status; } @@ -627,14 +544,12 @@ extern "C" { range->start += macro_f_utf_byte_width(buffer.string[range->start]); } // for - if (range->start > range->stop) { - return F_found_not; - } + if (range->start > range->stop || range->start > buffer.used) return F_found_not; if (range->stop - range->start < 5) { // Increment until stop, while taking into consideration UTF-8 character widths. - for (; range->start <= range->stop; ) { + for (; range->start <= range->stop && range->start < buffer.used; ) { if (buffer.string[range->start] == f_string_eol_s.string[0]) { ++range->start; @@ -650,7 +565,7 @@ extern "C" { f_array_length_t i = range->start; - for (; range->start <= range->stop; ) { + for (; range->start <= range->stop && range->start < buffer.used; ) { status = f_utf_is_word(buffer.string + range->start, (range->stop - range->start) + 1, F_true); if (F_status_is_error(status)) return status; @@ -668,10 +583,10 @@ extern "C" { range->start += macro_f_utf_byte_width(buffer.string[range->start]); } // for - if (range->start > range->stop || buffer.string[range->start] != f_string_ascii_minus_s.string[0]) { + if (range->start > range->stop || range->start >= buffer.used || buffer.string[range->start] != f_string_ascii_minus_s.string[0]) { // Increment until stop, while taking into consideration UTF-8 character widths. - for (; range->start <= range->stop; ) { + for (; range->start <= range->stop && range->start < buffer.used; ) { if (buffer.string[range->start] == f_string_eol_s.string[0]) { ++range->start; @@ -689,13 +604,13 @@ extern "C" { f_array_length_t j = 0; f_char_t number[5] = { 0, 0, 0, 0, 0 }; - for (++range->start; range->start <= range->stop && j < 4; ++range->start, ++j) { + for (++range->start; range->start <= range->stop && range->start < buffer.used && j < 4; ++range->start, ++j) { // The hexidecimal representing the number may only be ASCII. if (macro_f_utf_byte_width_is(buffer.string[range->start])) { // Increment until stop, while taking into consideration UTF-8 character widths. - for (; range->start <= range->stop; ) { + for (; range->start <= range->stop && range->start < buffer.used; ) { if (buffer.string[range->start] == f_string_eol_s.string[0]) { ++range->start; @@ -731,7 +646,7 @@ extern "C" { else { // Increment until stop, while taking into consideration UTF-8 character widths. - for (; range->start <= range->stop; ) { + for (; range->start <= range->stop && range->start < buffer.used; ) { if (buffer.string[range->start] == f_string_eol_s.string[0]) { ++range->start; @@ -751,7 +666,7 @@ extern "C" { } // Skip past all NULLs. - for (; range->start <= range->stop; ++range->start) { + for (; range->start <= range->stop && range->start < buffer.used; ++range->start) { if (buffer.string[range->start]) break; } // for @@ -770,7 +685,7 @@ extern "C" { if (status == F_false) { // Increment until stop, while taking into consideration UTF-8 character widths. - for (; range->start <= range->stop; ) { + for (; range->start <= range->stop && range->start < buffer.used; ) { if (buffer.string[range->start] == f_string_eol_s.string[0]) { ++range->start; @@ -794,7 +709,7 @@ extern "C" { } if (id) { - for (f_array_length_t j = i, i = 0; j <= range->stop; ++j) { + for (f_array_length_t j = i, i = 0; j <= range->stop && j < buffer.used; ++j) { if (!buffer.string[j]) continue; if (buffer.string[j] == f_string_ascii_minus_s.string[0]) break; @@ -819,18 +734,15 @@ extern "C" { if (!destination) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (!length) { - return F_data_not_eos; - } + if (!length) return F_data_not_eos; f_array_length_t begin = 0; f_array_length_t end = length - 1; - const f_status_t status = private_fl_string_rip_find_range(source, &begin, &end); - if (F_status_is_error(status)) return status; - - if (status == F_data_not) { - return status; + { + const f_status_t status = private_fl_string_rip_find_range(source, &begin, &end); + if (F_status_is_error(status)) return status; + if (status == F_data_not) return status; } return f_string_append(source + begin, (end - begin) + 1, destination); @@ -843,18 +755,15 @@ extern "C" { if (!destination) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (!length) { - return F_data_not_eos; - } + if (!length) return F_data_not_eos; f_array_length_t begin = 0; f_array_length_t end = length - 1; - const f_status_t status = private_fl_string_rip_find_range(source, &begin, &end); - if (F_status_is_error(status)) return status; - - if (status == F_data_not) { - return status; + { + const f_status_t status = private_fl_string_rip_find_range(source, &begin, &end); + if (F_status_is_error(status)) return status; + if (status == F_data_not) return status; } return f_string_append_nulless(source + begin, (end - begin) + 1, destination); @@ -867,9 +776,7 @@ extern "C" { if (!range) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (range->start > range->stop) { - return F_data_not_stop; - } + if (range->start > range->stop) return F_data_not_stop; const unsigned short seek_width = macro_f_utf_char_t_width(seek_to); @@ -887,34 +794,22 @@ extern "C" { if (!width) { width = 1; - if (string[range->start] == f_string_eol_s.string[0]) { - return F_none_eol; - } - - if (seek_width == width) { - if (string[range->start] == seek_to) { - return F_none; - } - } + if (string[range->start] == f_string_eol_s.string[0]) return F_none_eol; + if (seek_width == width && string[range->start] == seek_to) return F_none; } // Do not operate on UTF-8 fragments that are not the first byte of the character. else if (width == 1) { return F_status_set_error(F_complete_not_utf); } else { - if (range->start + width > range->stop) { - return F_status_set_error(F_complete_not_utf_eos); - } + if (range->start + width > range->stop) return F_status_set_error(F_complete_not_utf_eos); if (width == seek_width) { f_utf_char_t character = 0; status = f_utf_char_to_character(string + range->start, width_max, &character); if (F_status_is_error(status)) return status; - - if (character == seek_to) { - return F_none; - } + if (character == seek_to) return F_none; } } } // for @@ -929,9 +824,7 @@ extern "C" { if (!range) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (range->start > range->stop) { - return F_data_not_stop; - } + if (range->start > range->stop) return F_data_not_stop; f_status_t status = F_none; unsigned short width = 0; @@ -941,10 +834,7 @@ extern "C" { while (string[range->start] == placeholder || (status = f_utf_is_graph(string + range->start, width_max)) == F_false) { if (F_status_is_error(status)) return status; - - if (string[range->start] == f_string_eol_s.string[0]) { - return F_none_eol; - } + if (string[range->start] == f_string_eol_s.string[0]) return F_none_eol; width = macro_f_utf_byte_width_is(string[range->start]); @@ -957,16 +847,12 @@ extern "C" { return F_status_set_error(F_complete_not_utf); } else { - if (range->start + width > range->stop) { - return F_status_set_error(F_complete_not_utf_stop); - } + if (range->start + width > range->stop) return F_status_set_error(F_complete_not_utf_stop); } range->start += width; - if (range->start > range->stop) { - return F_none_stop; - } + if (range->start > range->stop) return F_none_stop; width_max = (range->stop - range->start) + 1; } // while @@ -983,9 +869,7 @@ extern "C" { if (!range) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (range->start > range->stop) { - return F_data_not_stop; - } + if (range->start > range->stop) return F_data_not_stop; f_status_t status = F_none; unsigned short width = 0; @@ -995,10 +879,7 @@ extern "C" { while (string[range->start] == placeholder || (status = f_utf_is_whitespace(string + range->start, width_max, F_false)) == F_false) { if (F_status_is_error(status)) return status; - - if (string[range->start] == f_string_eol_s.string[0]) { - return F_none_eol; - } + if (string[range->start] == f_string_eol_s.string[0]) return F_none_eol; width = macro_f_utf_byte_width_is(string[range->start]); @@ -1011,16 +892,12 @@ extern "C" { return F_status_set_error(F_complete_not_utf); } else { - if (range->start + width > range->stop) { - return F_status_set_error(F_complete_not_utf_stop); - } + if (range->start + width > range->stop) return F_status_set_error(F_complete_not_utf_stop); } range->start += width; - if (range->start > range->stop) { - return F_none_stop; - } + if (range->start > range->stop) return F_none_stop; width_max = (range->stop - range->start) + 1; } // while @@ -1037,9 +914,7 @@ extern "C" { if (!range) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (range->start > range->stop) { - return F_data_not_stop; - } + if (range->start > range->stop) return F_data_not_stop; const unsigned short seek_width = macro_f_utf_char_t_width(seek_to); @@ -1057,30 +932,21 @@ extern "C" { if (!width) { width = 1; - if (seek_width == width) { - if (string[range->start] == seek_to) { - return F_none; - } - } + if (seek_width == width && string[range->start] == seek_to) return F_none; } // Do not operate on UTF-8 fragments that are not the first byte of the character. else if (width == 1) { return F_status_set_error(F_complete_not_utf); } else { - if (range->start + width > range->stop) { - return F_status_set_error(F_complete_not_utf_stop); - } + if (range->start + width > range->stop) return F_status_set_error(F_complete_not_utf_stop); if (width == seek_width) { f_utf_char_t character = 0; status = f_utf_char_to_character(string + range->start, width_max, &character); if (F_status_is_error(status)) return status; - - if (character == seek_to) { - return F_none; - } + if (character == seek_to) return F_none; } } } // for diff --git a/level_1/fl_string/c/string.h b/level_1/fl_string/c/string.h index 5d41ad1..f1802c9 100644 --- a/level_1/fl_string/c/string.h +++ b/level_1/fl_string/c/string.h @@ -886,12 +886,15 @@ extern "C" { * @return * F_none on success. * F_none_eol on success, but stopped at EOL. + * F_none_eos on success, but stopped at end of buffer. * F_none_stop on success, but stopped at end of range. * F_data_not on success, but there was no string data to seek. + * F_data_not_eos on success, but the range.start >= buffer.used. * F_data_not_stop on success, but the range.start > range.stop. * * F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment. * F_complete_not_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. + * F_complete_not_utf_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed. * F_parameter (with error bit) if a parameter is invalid. * F_utf_not (with error bit) if character is an invalid UTF-8 character. * @@ -916,12 +919,15 @@ extern "C" { * @return * F_none on success. * F_none_eol on success, but stopped at EOL. + * F_none_eos on success, but stopped at end of buffer. * F_none_stop on success, but stopped at end of range. * F_data_not on success, but there was no string data to seek. + * F_data_not_eos on success, but the range.start >= buffer.used. * F_data_not_stop on success, but the range.start > range.stop. * * F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment. * F_complete_not_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. + * F_complete_not_utf_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed. * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. * @@ -946,12 +952,15 @@ extern "C" { * @return * F_none on success. * F_none_eol on success, but stopped at EOL. + * F_none_eos on success, but stopped at end of buffer. * F_none_stop on success, but stopped at end of range. * F_data_not on success, but there was no string data to seek. + * F_data_not_eos on success, but the range.start >= buffer.used. * F_data_not_stop on success, but the range.start > range.stop. * * F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment. * F_complete_not_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. + * F_complete_not_utf_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed. * F_memory_not (with error bit) on out of memory. * F_parameter (with error bit) if a parameter is invalid. * @@ -977,11 +986,14 @@ extern "C" { * @return * F_none on success. * F_none_stop on success, but stopped at end of range. + * F_none_eos on success, but stopped at end of buffer. * F_data_not on success, but there was no string data to seek. + * F_data_not_eos on success, but the range.start >= buffer.used. * F_data_not_stop on success, but the range.start > range.stop. * * F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment. * F_complete_not_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. + * F_complete_not_utf_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed. * F_parameter (with error bit) if a parameter is invalid. * F_utf_not (with error bit) if character is an invalid UTF-8 character. * @@ -1025,6 +1037,8 @@ extern "C" { * * @return * F_data_not if length is 0. + * F_data_not_eos on success, but the range.start >= buffer.used. + * F_data_not_stop on success, but the range.start > range.stop. * F_found if the buffer does represent a valid FLL Identifier. * F_found_not if the buffer does not represent a valid FLL Identifier. * -- 1.8.3.1