Prevent integer overflow due to fontstat

This commit is contained in:
Tatsuya Kinoshita
2021-04-11 08:18:36 +09:00
parent 38c043f50f
commit 56ce2a2cc8
2 changed files with 15 additions and 7 deletions

1
fm.h
View File

@@ -583,6 +583,7 @@ typedef struct _DownloadList {
#define FONT_STACK_SIZE 5
#define FONTSTAT_SIZE 7
#define FONTSTAT_MAX 127
#define _INIT_BUFFER_WIDTH (COLS - (showLineNum ? 6 : 1))
#define INIT_BUFFER_WIDTH ((_INIT_BUFFER_WIDTH > 0) ? _INIT_BUFFER_WIDTH : 0)