|
1 http://sourceforge.net/p/net-snmp/official-patches/48 |
|
2 http://sourceforge.net/p/net-snmp/code/ci/7f4a7b891332899cea26e95be0337aae01648742 |
|
3 |
|
4 diff --git a/snmplib/mib.c b/snmplib/mib.c |
|
5 index b0a7d29..e2fd906 100644 |
|
6 --- a/snmplib/mib.c |
|
7 +++ b/snmplib/mib.c |
|
8 @@ -436,17 +436,16 @@ sprint_realloc_octet_string(u_char ** buf, size_t * buf_len, |
|
9 u_char *cp; |
|
10 int output_format; |
|
11 |
|
12 - if ((var->type != ASN_OCTET_STR) && |
|
13 - (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { |
|
14 - const char str[] = "Wrong Type (should be OCTET STRING): "; |
|
15 - if (snmp_cstrcat |
|
16 - (buf, buf_len, out_len, allow_realloc, str)) { |
|
17 - return sprint_realloc_by_type(buf, buf_len, out_len, |
|
18 + if (var->type != ASN_OCTET_STR) { |
|
19 + if (!netsnmp_ds_get_boolean( |
|
20 + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { |
|
21 + const char str[] = "Wrong Type (should be OCTET STRING): "; |
|
22 + if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, str)) |
|
23 + return 0; |
|
24 + } |
|
25 + return sprint_realloc_by_type(buf, buf_len, out_len, |
|
26 allow_realloc, var, NULL, NULL, |
|
27 NULL); |
|
28 - } else { |
|
29 - return 0; |
|
30 - } |
|
31 } |
|
32 |
|
33 |
|
34 @@ -704,16 +703,16 @@ sprint_realloc_float(u_char ** buf, size_t * buf_len, |
|
35 const struct enum_list *enums, |
|
36 const char *hint, const char *units) |
|
37 { |
|
38 - if ((var->type != ASN_OPAQUE_FLOAT) && |
|
39 - (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { |
|
40 - if (snmp_cstrcat(buf, buf_len, out_len, allow_realloc, |
|
41 - "Wrong Type (should be Float): ")) { |
|
42 - return sprint_realloc_by_type(buf, buf_len, out_len, |
|
43 + if (var->type != ASN_OPAQUE_FLOAT) { |
|
44 + if (!netsnmp_ds_get_boolean( |
|
45 + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { |
|
46 + u_char str[] = "Wrong Type (should be Float): "; |
|
47 + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) |
|
48 + return 0; |
|
49 + } |
|
50 + return sprint_realloc_by_type(buf, buf_len, out_len, |
|
51 allow_realloc, var, NULL, NULL, |
|
52 NULL); |
|
53 - } else { |
|
54 - return 0; |
|
55 - } |
|
56 } |
|
57 |
|
58 if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { |
|
59 @@ -774,17 +773,16 @@ sprint_realloc_double(u_char ** buf, size_t * buf_len, |
|
60 const struct enum_list *enums, |
|
61 const char *hint, const char *units) |
|
62 { |
|
63 - if ((var->type != ASN_OPAQUE_DOUBLE) && |
|
64 - (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { |
|
65 - if (snmp_cstrcat |
|
66 - (buf, buf_len, out_len, allow_realloc, |
|
67 - "Wrong Type (should be Double): ")) { |
|
68 - return sprint_realloc_by_type(buf, buf_len, out_len, |
|
69 + if (var->type != ASN_OPAQUE_DOUBLE) { |
|
70 + if (!netsnmp_ds_get_boolean( |
|
71 + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { |
|
72 + u_char str[] = "Wrong Type (should be Double): "; |
|
73 + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) |
|
74 + return 0; |
|
75 + } |
|
76 + return sprint_realloc_by_type(buf, buf_len, out_len, |
|
77 allow_realloc, var, NULL, NULL, |
|
78 NULL); |
|
79 - } else { |
|
80 - return 0; |
|
81 - } |
|
82 } |
|
83 |
|
84 if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { |
|
85 @@ -849,20 +847,21 @@ sprint_realloc_counter64(u_char ** buf, size_t * buf_len, size_t * out_len, |
|
86 { |
|
87 char a64buf[I64CHARSZ + 1]; |
|
88 |
|
89 - if ((var->type != ASN_COUNTER64 |
|
90 + if (var->type != ASN_COUNTER64 |
|
91 #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES |
|
92 && var->type != ASN_OPAQUE_COUNTER64 |
|
93 && var->type != ASN_OPAQUE_I64 && var->type != ASN_OPAQUE_U64 |
|
94 #endif |
|
95 - ) && (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { |
|
96 - if (snmp_cstrcat(buf, buf_len, out_len, allow_realloc, |
|
97 - "Wrong Type (should be Counter64): ")) { |
|
98 - return sprint_realloc_by_type(buf, buf_len, out_len, |
|
99 + ) { |
|
100 + if (!netsnmp_ds_get_boolean( |
|
101 + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { |
|
102 + u_char str[] = "Wrong Type (should be Counter64): "; |
|
103 + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) |
|
104 + return 0; |
|
105 + } |
|
106 + return sprint_realloc_by_type(buf, buf_len, out_len, |
|
107 allow_realloc, var, NULL, NULL, |
|
108 NULL); |
|
109 - } else { |
|
110 - return 0; |
|
111 - } |
|
112 } |
|
113 |
|
114 if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { |
|
115 @@ -950,23 +949,25 @@ sprint_realloc_opaque(u_char ** buf, size_t * buf_len, |
|
116 const struct enum_list *enums, |
|
117 const char *hint, const char *units) |
|
118 { |
|
119 - if ((var->type != ASN_OPAQUE |
|
120 + if (var->type != ASN_OPAQUE |
|
121 #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES |
|
122 && var->type != ASN_OPAQUE_COUNTER64 |
|
123 && var->type != ASN_OPAQUE_U64 |
|
124 && var->type != ASN_OPAQUE_I64 |
|
125 && var->type != ASN_OPAQUE_FLOAT && var->type != ASN_OPAQUE_DOUBLE |
|
126 #endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */ |
|
127 - ) && (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { |
|
128 - if (snmp_cstrcat(buf, buf_len, out_len, allow_realloc, |
|
129 - "Wrong Type (should be Opaque): ")) { |
|
130 - return sprint_realloc_by_type(buf, buf_len, out_len, |
|
131 + ) { |
|
132 + if (!netsnmp_ds_get_boolean( |
|
133 + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { |
|
134 + u_char str[] = "Wrong Type (should be Opaque): "; |
|
135 + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) |
|
136 + return 0; |
|
137 + } |
|
138 + return sprint_realloc_by_type(buf, buf_len, out_len, |
|
139 allow_realloc, var, NULL, NULL, |
|
140 NULL); |
|
141 - } else { |
|
142 - return 0; |
|
143 - } |
|
144 } |
|
145 + |
|
146 #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES |
|
147 switch (var->type) { |
|
148 case ASN_OPAQUE_COUNTER64: |
|
149 @@ -1042,17 +1043,16 @@ sprint_realloc_object_identifier(u_char ** buf, size_t * buf_len, |
|
150 { |
|
151 int buf_overflow = 0; |
|
152 |
|
153 - if ((var->type != ASN_OBJECT_ID) && |
|
154 - (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { |
|
155 - u_char str[] = |
|
156 - "Wrong Type (should be OBJECT IDENTIFIER): "; |
|
157 - if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { |
|
158 - return sprint_realloc_by_type(buf, buf_len, out_len, |
|
159 + if (var->type != ASN_OBJECT_ID) { |
|
160 + if (!netsnmp_ds_get_boolean( |
|
161 + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { |
|
162 + u_char str[] = "Wrong Type (should be OBJECT IDENTIFIER): "; |
|
163 + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) |
|
164 + return 0; |
|
165 + } |
|
166 + return sprint_realloc_by_type(buf, buf_len, out_len, |
|
167 allow_realloc, var, NULL, NULL, |
|
168 NULL); |
|
169 - } else { |
|
170 - return 0; |
|
171 - } |
|
172 } |
|
173 |
|
174 if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { |
|
175 @@ -1112,16 +1112,16 @@ sprint_realloc_timeticks(u_char ** buf, size_t * buf_len, size_t * out_len, |
|
176 { |
|
177 char timebuf[40]; |
|
178 |
|
179 - if ((var->type != ASN_TIMETICKS) && |
|
180 - (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { |
|
181 - u_char str[] = "Wrong Type (should be Timeticks): "; |
|
182 - if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { |
|
183 - return sprint_realloc_by_type(buf, buf_len, out_len, |
|
184 + if (var->type != ASN_TIMETICKS) { |
|
185 + if (!netsnmp_ds_get_boolean( |
|
186 + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { |
|
187 + u_char str[] = "Wrong Type (should be Timeticks): "; |
|
188 + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) |
|
189 + return 0; |
|
190 + } |
|
191 + return sprint_realloc_by_type(buf, buf_len, out_len, |
|
192 allow_realloc, var, NULL, NULL, |
|
193 NULL); |
|
194 - } else { |
|
195 - return 0; |
|
196 - } |
|
197 } |
|
198 |
|
199 if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_NUMERIC_TIMETICKS)) { |
|
200 @@ -1260,17 +1260,18 @@ sprint_realloc_integer(u_char ** buf, size_t * buf_len, size_t * out_len, |
|
201 { |
|
202 char *enum_string = NULL; |
|
203 |
|
204 - if ((var->type != ASN_INTEGER) && |
|
205 - (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { |
|
206 - u_char str[] = "Wrong Type (should be INTEGER): "; |
|
207 - if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { |
|
208 - return sprint_realloc_by_type(buf, buf_len, out_len, |
|
209 + if (var->type != ASN_INTEGER) { |
|
210 + if (!netsnmp_ds_get_boolean( |
|
211 + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { |
|
212 + u_char str[] = "Wrong Type (should be INTEGER): "; |
|
213 + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) |
|
214 + return 0; |
|
215 + } |
|
216 + return sprint_realloc_by_type(buf, buf_len, out_len, |
|
217 allow_realloc, var, NULL, NULL, |
|
218 NULL); |
|
219 - } else { |
|
220 - return 0; |
|
221 - } |
|
222 } |
|
223 + |
|
224 for (; enums; enums = enums->next) { |
|
225 if (enums->value == *var->val.integer) { |
|
226 enum_string = enums->label; |
|
227 @@ -1363,16 +1364,16 @@ sprint_realloc_uinteger(u_char ** buf, size_t * buf_len, size_t * out_len, |
|
228 { |
|
229 char *enum_string = NULL; |
|
230 |
|
231 - if ((var->type != ASN_UINTEGER) && |
|
232 - (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { |
|
233 - u_char str[] = "Wrong Type (should be UInteger32): "; |
|
234 - if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { |
|
235 - return sprint_realloc_by_type(buf, buf_len, out_len, |
|
236 + if (var->type != ASN_UINTEGER) { |
|
237 + if (!netsnmp_ds_get_boolean( |
|
238 + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { |
|
239 + u_char str[] = "Wrong Type (should be UInteger32): "; |
|
240 + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) |
|
241 + return 0; |
|
242 + } |
|
243 + return sprint_realloc_by_type(buf, buf_len, out_len, |
|
244 allow_realloc, var, NULL, NULL, |
|
245 NULL); |
|
246 - } else { |
|
247 - return 0; |
|
248 - } |
|
249 } |
|
250 |
|
251 for (; enums; enums = enums->next) { |
|
252 @@ -1460,17 +1461,16 @@ sprint_realloc_gauge(u_char ** buf, size_t * buf_len, size_t * out_len, |
|
253 { |
|
254 char tmp[32]; |
|
255 |
|
256 - if ((var->type != ASN_GAUGE) && |
|
257 - (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { |
|
258 - u_char str[] = |
|
259 - "Wrong Type (should be Gauge32 or Unsigned32): "; |
|
260 - if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { |
|
261 - return sprint_realloc_by_type(buf, buf_len, out_len, |
|
262 + if (var->type != ASN_GAUGE) { |
|
263 + if (!netsnmp_ds_get_boolean( |
|
264 + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { |
|
265 + u_char str[] = "Wrong Type (should be Gauge32 or Unsigned32): "; |
|
266 + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) |
|
267 + return 0; |
|
268 + } |
|
269 + return sprint_realloc_by_type(buf, buf_len, out_len, |
|
270 allow_realloc, var, NULL, NULL, |
|
271 NULL); |
|
272 - } else { |
|
273 - return 0; |
|
274 - } |
|
275 } |
|
276 |
|
277 if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { |
|
278 @@ -1533,16 +1533,16 @@ sprint_realloc_counter(u_char ** buf, size_t * buf_len, size_t * out_len, |
|
279 { |
|
280 char tmp[32]; |
|
281 |
|
282 - if ((var->type != ASN_COUNTER) && |
|
283 - (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { |
|
284 - u_char str[] = "Wrong Type (should be Counter32): "; |
|
285 - if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { |
|
286 - return sprint_realloc_by_type(buf, buf_len, out_len, |
|
287 + if (var->type != ASN_COUNTER) { |
|
288 + if (!netsnmp_ds_get_boolean( |
|
289 + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { |
|
290 + u_char str[] = "Wrong Type (should be Counter32): "; |
|
291 + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) |
|
292 + return 0; |
|
293 + } |
|
294 + return sprint_realloc_by_type(buf, buf_len, out_len, |
|
295 allow_realloc, var, NULL, NULL, |
|
296 NULL); |
|
297 - } else { |
|
298 - return 0; |
|
299 - } |
|
300 } |
|
301 |
|
302 if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { |
|
303 @@ -1596,16 +1596,16 @@ sprint_realloc_networkaddress(u_char ** buf, size_t * buf_len, |
|
304 { |
|
305 size_t i; |
|
306 |
|
307 - if ((var->type != ASN_IPADDRESS) && |
|
308 - (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { |
|
309 - u_char str[] = "Wrong Type (should be NetworkAddress): "; |
|
310 - if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { |
|
311 - return sprint_realloc_by_type(buf, buf_len, out_len, |
|
312 + if (var->type != ASN_IPADDRESS) { |
|
313 + if (!netsnmp_ds_get_boolean( |
|
314 + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { |
|
315 + u_char str[] = "Wrong Type (should be NetworkAddress): "; |
|
316 + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) |
|
317 + return 0; |
|
318 + } |
|
319 + return sprint_realloc_by_type(buf, buf_len, out_len, |
|
320 allow_realloc, var, NULL, NULL, |
|
321 NULL); |
|
322 - } else { |
|
323 - return 0; |
|
324 - } |
|
325 } |
|
326 |
|
327 if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { |
|
328 @@ -1662,16 +1662,16 @@ sprint_realloc_ipaddress(u_char ** buf, size_t * buf_len, size_t * out_len, |
|
329 { |
|
330 u_char *ip = var->val.string; |
|
331 |
|
332 - if ((var->type != ASN_IPADDRESS) && |
|
333 - (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { |
|
334 - u_char str[] = "Wrong Type (should be IpAddress): "; |
|
335 - if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { |
|
336 - return sprint_realloc_by_type(buf, buf_len, out_len, |
|
337 + if (var->type != ASN_IPADDRESS) { |
|
338 + if (!netsnmp_ds_get_boolean( |
|
339 + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { |
|
340 + u_char str[] = "Wrong Type (should be IpAddress): "; |
|
341 + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) |
|
342 + return 0; |
|
343 + } |
|
344 + return sprint_realloc_by_type(buf, buf_len, out_len, |
|
345 allow_realloc, var, NULL, NULL, |
|
346 NULL); |
|
347 - } else { |
|
348 - return 0; |
|
349 - } |
|
350 } |
|
351 |
|
352 if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { |
|
353 @@ -1720,20 +1720,20 @@ sprint_realloc_null(u_char ** buf, size_t * buf_len, size_t * out_len, |
|
354 const struct enum_list *enums, |
|
355 const char *hint, const char *units) |
|
356 { |
|
357 - if ((var->type != ASN_NULL) && |
|
358 - (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { |
|
359 - u_char str[] = "Wrong Type (should be NULL): "; |
|
360 - if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { |
|
361 - return sprint_realloc_by_type(buf, buf_len, out_len, |
|
362 + if (var->type != ASN_NULL) { |
|
363 + if (!netsnmp_ds_get_boolean( |
|
364 + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { |
|
365 + u_char str[] = "Wrong Type (should be NULL): "; |
|
366 + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) |
|
367 + return 0; |
|
368 + } |
|
369 + return sprint_realloc_by_type(buf, buf_len, out_len, |
|
370 allow_realloc, var, NULL, NULL, |
|
371 NULL); |
|
372 - } else { |
|
373 - return 0; |
|
374 - } |
|
375 - } else { |
|
376 - u_char str[] = "NULL"; |
|
377 - return snmp_strcat(buf, buf_len, out_len, allow_realloc, str); |
|
378 } |
|
379 + |
|
380 + u_char str[] = "NULL"; |
|
381 + return snmp_strcat(buf, buf_len, out_len, allow_realloc, str); |
|
382 } |
|
383 |
|
384 |
|
385 @@ -1768,16 +1768,16 @@ sprint_realloc_bitstring(u_char ** buf, size_t * buf_len, size_t * out_len, |
|
386 u_char *cp; |
|
387 char *enum_string; |
|
388 |
|
389 - if ((var->type != ASN_BIT_STR && var->type != ASN_OCTET_STR) && |
|
390 - (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { |
|
391 - u_char str[] = "Wrong Type (should be BITS): "; |
|
392 - if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { |
|
393 - return sprint_realloc_by_type(buf, buf_len, out_len, |
|
394 + if (var->type != ASN_BIT_STR && var->type != ASN_OCTET_STR) { |
|
395 + if (!netsnmp_ds_get_boolean( |
|
396 + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { |
|
397 + u_char str[] = "Wrong Type (should be BITS): "; |
|
398 + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) |
|
399 + return 0; |
|
400 + } |
|
401 + return sprint_realloc_by_type(buf, buf_len, out_len, |
|
402 allow_realloc, var, NULL, NULL, |
|
403 NULL); |
|
404 - } else { |
|
405 - return 0; |
|
406 - } |
|
407 } |
|
408 |
|
409 if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { |
|
410 @@ -1852,16 +1852,16 @@ sprint_realloc_nsapaddress(u_char ** buf, size_t * buf_len, |
|
411 const struct enum_list *enums, const char *hint, |
|
412 const char *units) |
|
413 { |
|
414 - if ((var->type != ASN_NSAP) && |
|
415 - (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { |
|
416 - u_char str[] = "Wrong Type (should be NsapAddress): "; |
|
417 - if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { |
|
418 - return sprint_realloc_by_type(buf, buf_len, out_len, |
|
419 + if (var->type != ASN_NSAP) { |
|
420 + if (!netsnmp_ds_get_boolean( |
|
421 + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { |
|
422 + u_char str[] = "Wrong Type (should be NsapAddress): "; |
|
423 + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) |
|
424 + return 0; |
|
425 + } |
|
426 + return sprint_realloc_by_type(buf, buf_len, out_len, |
|
427 allow_realloc, var, NULL, NULL, |
|
428 NULL); |
|
429 - } else { |
|
430 - return 0; |
|
431 - } |
|
432 } |
|
433 |
|
434 if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { |