summaryrefslogtreecommitdiffstats
path: root/RichString.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-10-27 21:26:35 +0100
committercgzones <cgzones@googlemail.com>2020-10-28 19:57:10 +0100
commit70199495747543c97a05ca2d692780107e528ebd (patch)
tree5000d497739e90bb75162b80d995178b3d126efe /RichString.c
parent8c1f5c5a6f341fc654808887fcbeec0ba2994f95 (diff)
Implement RichString_setLen as function
Make it more readable and fix unenclosed macro arguments
Diffstat (limited to 'RichString.c')
-rw-r--r--RichString.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/RichString.c b/RichString.c
index 90cc428c..bda39181 100644
--- a/RichString.c
+++ b/RichString.c
@@ -36,7 +36,14 @@ static void RichString_extendLen(RichString* this, int len) {
this->chlen = len;
}
-#define RichString_setLen(this, len) do{ if(len < RICHSTRING_MAXLEN && this->chlen < RICHSTRING_MAXLEN) { RichString_setChar(this,len,0); this->chlen=len; } else RichString_extendLen(this,len); }while(0)
+static void RichString_setLen(RichString* this, int len) {
+ if (len < RICHSTRING_MAXLEN && this->chlen < RICHSTRING_MAXLEN) {
+ RichString_setChar(this, len, 0);
+ this->chlen = len;
+ } else {
+ RichString_extendLen(this, len);
+ }
+}
#ifdef HAVE_LIBNCURSESW

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