Commit f5526b1
Fix: Add wrapers on const values to use in hosts_ctl()
To prevent compilation warnings in snmp_agent.c and snmptrapd.c about discard 'const' qualifier:
snmp_agent.c:1082:29: warning: passing argument 2 of 'hosts_ctl' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
1082 | if (hosts_ctl(name, STRING_UNKNOWN, sbuf, STRING_UNKNOWN)) {
| ^~~~~~~~~~~~~~
In file included from snmp_agent.c:94:
/usr/include/tcpd.h:131:42: note: expected 'char *' but argument is of type 'const char *'
131 | extern int hosts_ctl(char *daemon, char *client_name, char *client_addr,
| ~~~~~~^~~~~~~~~~~
snmp_agent.c:1082:51: warning: passing argument 4 of 'hosts_ctl' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
1082 | if (hosts_ctl(name, STRING_UNKNOWN, sbuf, STRING_UNKNOWN)) {
| ^~~~~~~~~~~~~~
/usr/include/tcpd.h:132:23: note: expected 'char *' but argument is of type 'const char *'
132 | char *client_user);
| ~~~~~~^~~~~~~~~~~1 parent 36fc055 commit f5526b1
2 files changed
+14
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1037 | 1037 | | |
1038 | 1038 | | |
1039 | 1039 | | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
1040 | 1045 | | |
1041 | 1046 | | |
1042 | 1047 | | |
| |||
1079 | 1084 | | |
1080 | 1085 | | |
1081 | 1086 | | |
1082 | | - | |
| 1087 | + | |
1083 | 1088 | | |
1084 | 1089 | | |
1085 | 1090 | | |
| |||
1096 | 1101 | | |
1097 | 1102 | | |
1098 | 1103 | | |
1099 | | - | |
| 1104 | + | |
1100 | 1105 | | |
1101 | 1106 | | |
1102 | 1107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
287 | 292 | | |
288 | 293 | | |
289 | 294 | | |
| |||
308 | 313 | | |
309 | 314 | | |
310 | 315 | | |
311 | | - | |
312 | | - | |
| 316 | + | |
313 | 317 | | |
314 | 318 | | |
315 | 319 | | |
316 | 320 | | |
317 | 321 | | |
318 | 322 | | |
319 | 323 | | |
320 | | - | |
321 | | - | |
| 324 | + | |
322 | 325 | | |
323 | 326 | | |
324 | 327 | | |
| |||
0 commit comments