diff options
| author | Alex Colomar <alx.manpages@gmail.com> | 2022-09-10 23:42:09 +0200 |
|---|---|---|
| committer | Alex Colomar <alx.manpages@gmail.com> | 2022-09-12 16:40:00 +0200 |
| commit | 8e6b55a7bee1b51ef7d6ab58f77023fca47625c4 (patch) | |
| tree | 4511781e66a313fcb90cb0d8d4e46a20e4e2cdb2 | |
| parent | a98bd8eb3033819b3a03e75c75c8bac4737e4ff4 (diff) | |
| download | man-pages-8e6b55a7bee1b51ef7d6ab58f77023fca47625c4.tar.gz | |
bsearch.3: EXAMPLES: Separate struct and variable definitions
Separate struct definition from variable definition.
Also use 'static' and 'const' when possible.
Signed-off-by: Alex Colomar <alx.manpages@gmail.com>
| -rw-r--r-- | man3/bsearch.3 | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/man3/bsearch.3 b/man3/bsearch.3 index ede91e3790..cf5fa7a0ab 100644 --- a/man3/bsearch.3 +++ b/man3/bsearch.3 @@ -89,9 +89,11 @@ then retrieves desired elements using #include <string.h> struct mi { - int nr; - char *name; -} months[] = { + int nr; + const char *name; +}; + +static struct mi months[] = { { 1, "jan" }, { 2, "feb" }, { 3, "mar" }, { 4, "apr" }, { 5, "may" }, { 6, "jun" }, { 7, "jul" }, { 8, "aug" }, { 9, "sep" }, {10, "oct" }, {11, "nov" }, {12, "dec" } |
