MCPcopy Create free account
hub / github.com/OpenPrinting/cups / _cupsSNMPOIDToString

Function _cupsSNMPOIDToString

cups/snmp.c:256–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254
255
256char * /* O - New string or @code NULL@ on error */
257_cupsSNMPOIDToString(const int *src, /* I - OID */
258 char *dst, /* I - String buffer */
259 size_t dstsize) /* I - Size of string buffer */
260{
261 char *dstptr, /* Pointer into string buffer */
262 *dstend; /* End of string buffer */
263
264
265 DEBUG_printf(("4_cupsSNMPOIDToString(src=%p, dst=%p, dstsize=" CUPS_LLFMT ")",
266 src, dst, CUPS_LLCAST dstsize));
267
268 /*
269 * Range check input...
270 */
271
272 if (!src || !dst || dstsize < 4)
273 return (NULL);
274
275 /*
276 * Loop through the OID array and build a string...
277 */
278
279 for (dstptr = dst, dstend = dstptr + dstsize - 1;
280 *src >= 0 && dstptr < dstend;
281 src ++, dstptr += strlen(dstptr))
282 snprintf(dstptr, (size_t)(dstend - dstptr + 1), ".%d", *src);
283
284 if (*src >= 0)
285 return (NULL);
286 else
287 return (dst);
288}
289
290
291/*

Callers 3

backendNetworkSideCBFunction · 0.85
print_packetFunction · 0.85
show_oidFunction · 0.85

Calls

no outgoing calls

Tested by 2

print_packetFunction · 0.68
show_oidFunction · 0.68