patch 8.0.1723: using one item array size declaration is misleading
Problem: Using one item array size declaration is misleading.
Solution: Instead of using "[1]" and actually using a larger array, use
"[]". This is to verify that this C99 feature works for all
compilers.
diff --git a/src/structs.h b/src/structs.h
index d3f98ac..9202527 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -511,7 +511,7 @@
struct buffblock
{
buffblock_T *b_next; /* pointer to next buffblock */
- char_u b_str[1]; /* contents (actually longer) */
+ char_u b_str[]; /* contents (flexible array) */
};
/*
@@ -519,7 +519,7 @@
*/
struct buffheader
{
- buffblock_T bh_first; /* first (dummy) block of list */
+ buffblock_T *bh_first; /* first block of the list */
buffblock_T *bh_curr; /* buffblock for appending */
int bh_index; /* index for reading */
int bh_space; /* space in bh_curr for appending */