Commit e07727a
committed
Allocate hex map with the trailing NULL
Compilers usually warns or errors on such allocations. This would require
special compiler parameters or attribute to silence it. Unfortunately, it is
compiler specific, e.g. with gcc one could use "__attribute__ ((nonstring))"
or with C23 just "[[nonstring]]" or gcc parameter
"-Wno-error=unterminated-string-initialization". With other compilers
it's different. So do not over-complicate things and allocate it just one
more byte longer with the dummy NULL which should silence most of the
compilers. It's static allocation, just one byte, the overhead should be
negligible.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>1 parent 6c0ed39 commit e07727a
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
0 commit comments