mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-24 15:15:44 +00:00
Implement RichString_setLen as function
Make it more readable and fix unenclosed macro arguments
This commit is contained in:
parent
8c1f5c5a6f
commit
7019949574
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user