summaryrefslogtreecommitdiffstats
path: root/Panel.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2021-03-07 15:31:41 +0100
committerChristian Göttsche <cgzones@googlemail.com>2021-03-17 15:54:17 +0100
commit1e806f9899600256cbcc540715261f461e11dd25 (patch)
tree292ef9c567e8a0c2b17758f25eab49120aebfcc1 /Panel.c
parentd9f2eacbc5b3fccf63b24944ce9a30d762baea3c (diff)
RichString: do not unnecessarily clean whole buffer
The local stack buffer does not need to be cleaned to zeros when - just initialized, cause the length is set to 0 and the first character is set to '\0', so all printing functions will safely stop - no further used, i.e. the variable goes out of scope
Diffstat (limited to 'Panel.c')
-rw-r--r--Panel.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Panel.c b/Panel.c
index c43fafcd..69933aea 100644
--- a/Panel.c
+++ b/Panel.c
@@ -69,7 +69,7 @@ void Panel_done(Panel* this) {
free(this->eventHandlerState);
Vector_delete(this->items);
FunctionBar_delete(this->defaultBar);
- RichString_end(this->header);
+ RichString_delete(&this->header);
}
void Panel_setSelectionColor(Panel* this, ColorElements colorId) {
@@ -287,7 +287,7 @@ void Panel_draw(Panel* this, bool force_redraw, bool focus, bool highlightSelect
RichString_printoffnVal(item, y + line, x, scrollH, amt);
if (item.highlightAttr)
attrset(CRT_colors[RESET_COLOR]);
- RichString_end(item);
+ RichString_delete(&item);
line++;
}
while (line < h) {
@@ -316,8 +316,8 @@ void Panel_draw(Panel* this, bool force_redraw, bool focus, bool highlightSelect
RichString_printoffnVal(new, y + this->selected - first, x,
scrollH, MINIMUM(newLen - scrollH, this->w));
attrset(CRT_colors[RESET_COLOR]);
- RichString_end(new);
- RichString_end(old);
+ RichString_delete(&new);
+ RichString_delete(&old);
}
if (focus && (this->needsRedraw || force_redraw || !this->wasFocus)) {

© 2014-2024 Faster IT GmbH | imprint | privacy policy