From 213013e68e64a655e0c6cb56875ea9a7977fe2f6 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Wed, 12 Aug 2015 19:35:44 +0200 Subject: [PATCH] Codingstyle --- src/gwin/gwin_widget.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gwin/gwin_widget.c b/src/gwin/gwin_widget.c index 666987ac..6002ffa9 100644 --- a/src/gwin/gwin_widget.c +++ b/src/gwin/gwin_widget.c @@ -382,10 +382,10 @@ const GWidgetStyle *gwinGetDefaultStyle(void) { return defaultStyle; } - void gwinSetText(GHandle gh, const char *text, bool_t useAlloc) { - if (!(gh->flags & GWIN_FLG_WIDGET)) + if (!(gh->flags & GWIN_FLG_WIDGET)) { return; + } // Dispose of the old string if ((gh->flags & GWIN_FLG_ALLOCTXT)) { @@ -397,9 +397,9 @@ void gwinSetText(GHandle gh, const char *text, bool_t useAlloc) { } // Alloc the new text if required - if (!text || !*text) + if (!text || !*text) { gw->text = ""; - else if (useAlloc) { + } else if (useAlloc) { char *str; if ((str = gfxAlloc(strlen(text)+1))) { @@ -407,8 +407,10 @@ void gwinSetText(GHandle gh, const char *text, bool_t useAlloc) { strcpy(str, text); } gw->text = (const char *)str; - } else + } else { gw->text = text; + } + _gwinUpdate(gh); }