From cbfe3f1b0a735aca8d0710ffc441b370da5800e7 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Tue, 20 Mar 2012 21:23:03 -0500 Subject: [PATCH] Bugfix: don't forget to return f_none_on_eos and f_none_on_stop where applicable --- level_1/fl_fss/c/fss_basic.c | 12 ++++++++++++ level_1/fl_fss/c/fss_extended.c | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/level_1/fl_fss/c/fss_basic.c b/level_1/fl_fss/c/fss_basic.c index b23835b..b6dd2dc 100644 --- a/level_1/fl_fss/c/fss_basic.c +++ b/level_1/fl_fss/c/fss_basic.c @@ -450,6 +450,12 @@ extern "C"{ object->used = object_position.stop + 1; } + if (input->start > input->stop) { + return f_none_on_stop; + } else if (input->start >= buffer.used) { + return f_none_on_eos; + } + return f_none; } #endif // _di_fl_fss_basic_object_write_ @@ -496,6 +502,12 @@ extern "C"{ content->string[content_position.stop] = f_eol; content->used = content_position.stop + 1; + if (input->start > input->stop) { + return f_none_on_stop; + } else if (input->start >= buffer.used) { + return f_none_on_eos; + } + return f_none; } #endif // _di_fl_fss_basic_content_write_ diff --git a/level_1/fl_fss/c/fss_extended.c b/level_1/fl_fss/c/fss_extended.c index 903bc29..27fd439 100644 --- a/level_1/fl_fss/c/fss_extended.c +++ b/level_1/fl_fss/c/fss_extended.c @@ -582,6 +582,12 @@ extern "C"{ object->used = object_position.stop + 1; } + if (input->start > input->stop) { + return f_none_on_stop; + } else if (input->start >= buffer.used) { + return f_none_on_eos; + } + return f_none; } #endif // _di_fl_fss_extended_object_write_ -- 1.8.3.1