Renamed len to length

This commit is contained in:
Ashish Kumar Yadav 2021-02-10 21:33:58 +05:30
parent ab48cac19b
commit b9a5336aa1
2 changed files with 6 additions and 6 deletions

View file

@ -3,7 +3,7 @@ typedef struct {
char *const pathc; char *const pathc;
const int interval; const int interval;
const int signal; const int signal;
int length;
char curtext[CMDOUTLENGTH + 1 + DELIMITERLENGTH]; char curtext[CMDOUTLENGTH + 1 + DELIMITERLENGTH];
char prvtext[CMDOUTLENGTH + 1]; char prvtext[CMDOUTLENGTH + 1];
int len;
} Block; } Block;

View file

@ -231,7 +231,7 @@ updateblock(Block *block, int sigval)
if (!dirtyblock || block < dirtyblock) if (!dirtyblock || block < dirtyblock)
dirtyblock = block; dirtyblock = block;
} }
block->len = 0; block->length = 0;
} else { } else {
if (block->curtext[trd - 1] == '\n') if (block->curtext[trd - 1] == '\n')
trd--; trd--;
@ -244,7 +244,7 @@ updateblock(Block *block, int sigval)
if (!block->pathc) if (!block->pathc)
trd--; trd--;
memcpy(block->curtext + trd, delimiter, DELIMITERLENGTH); memcpy(block->curtext + trd, delimiter, DELIMITERLENGTH);
block->len = trd + DELIMITERLENGTH; block->length = trd + DELIMITERLENGTH;
} }
} }
} }
@ -256,10 +256,10 @@ updatestatus()
char *s = statustext; char *s = statustext;
for (Block *block = blocks; block < dirtyblock; block++) for (Block *block = blocks; block < dirtyblock; block++)
s += block->len; s += block->length;
for (Block *block = dirtyblock; block->pathu; block++) { for (Block *block = dirtyblock; block->pathu; block++) {
memcpy(s, block->curtext, block->len); memcpy(s, block->curtext, block->length);
s += block->len; s += block->length;
} }
if (s != statustext) if (s != statustext)
*(s - DELIMITERLENGTH) = '\0'; *(s - DELIMITERLENGTH) = '\0';