| 254 | |
| 255 | |
| 256 | char * /* 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 | /* |
no outgoing calls