Commit 71c969e
committed
Fix: Discarded-qualifiers errors in string searching functions
Currently Naemon uses a mix of (char *) and (const char *) as input
for different string functions such as strpbrk() or strchr().
Modern compilers and stricter build flags (-Werror)
throw errors when the result of string searching functions like
strpbrk() or strchr() is assigned to a non-const pointer,
especially when the input was cast to const char*.
This commit adds explicit (char *) casts to the return values of
strpbrk and strchr to ensure compatibility across different
compiler versions and to satisfy -Werror=discarded-qualifiers.
Affected functions:
- strpbrk
- strchr
Issues:
- #530
- #522
Signed-off-by: nook24 <info@nook24.eu>1 parent 611a5b6 commit 71c969e
4 files changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| |||
0 commit comments