Define ui.c BUF_LEN with enum

weechat-hashes
Curtis McEnroe 2018-08-07 14:14:07 -04:00
parent fa270d9287
commit 0b429a7ccc
No known key found for this signature in database
GPG Key ID: CEA2F97ADCFCD77C
1 changed files with 2 additions and 2 deletions

4
ui.c
View File

@ -299,12 +299,12 @@ static void logDown(void) {
ui.scroll = MIN(ui.scroll + logHeight() / 2, LOG_LINES);
}
enum { BUF_LEN = 512 };
static struct {
wchar_t buf[512];
wchar_t buf[BUF_LEN];
wchar_t *ptr;
wchar_t *end;
} line = { .ptr = line.buf, .end = line.buf };
static const size_t BUF_LEN = sizeof(line.buf) / sizeof(line.buf[0]);
static void left(void) {
if (line.ptr > line.buf) line.ptr--;