diff options
| author | Fabien Costantini <fabien@onepost.net> | 2012-04-21 15:05:00 +0000 |
|---|---|---|
| committer | Fabien Costantini <fabien@onepost.net> | 2012-04-21 15:05:00 +0000 |
| commit | 157a96aa4b074d07e4391a1731d75d4eb594087f (patch) | |
| tree | b94200c37457c04ad3a82cd3b5a0c2ad32e26ca4 /src/Fl_Text_Buffer.cxx | |
| parent | eb9b58c7cc5ca2692e5020a5d441b7085b730d9d (diff) | |
STR2783: make potential null string substituted to an empty string, still achieve internal cleanup in Fl_Text_Buffer::text(s)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9366 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Text_Buffer.cxx')
| -rw-r--r-- | src/Fl_Text_Buffer.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Fl_Text_Buffer.cxx b/src/Fl_Text_Buffer.cxx index 5b2f3a314..f2aaeb6c8 100644 --- a/src/Fl_Text_Buffer.cxx +++ b/src/Fl_Text_Buffer.cxx @@ -165,7 +165,11 @@ char *Fl_Text_Buffer::text() const { void Fl_Text_Buffer::text(const char *t) { IS_UTF8_ALIGNED(t) - + + // if t is null then substitute it with an empty string + // then don't return so that internal cleanup can happen + if (!t) t=""; + call_predelete_callbacks(0, length()); /* Save information for redisplay, and get rid of the old buffer */ |
