* This is a bit nasty, but allows us to not modify the env strings. */
| 401 | * This is a bit nasty, but allows us to not modify the env strings. |
| 402 | */ |
| 403 | static const char * |
| 404 | resource_string_copy(const char *s, int len) |
| 405 | { |
| 406 | static char stringbuf[256]; |
| 407 | static int offset = 0; |
| 408 | const char *ret; |
| 409 | |
| 410 | if (len == 0) |
| 411 | len = strlen(s); |
| 412 | if (len > 255) |
| 413 | return NULL; |
| 414 | if ((offset + len + 1) > 255) |
| 415 | offset = 0; |
| 416 | bcopy(s, &stringbuf[offset], len); |
| 417 | stringbuf[offset + len] = '\0'; |
| 418 | ret = &stringbuf[offset]; |
| 419 | offset += len + 1; |
| 420 | return ret; |
| 421 | } |
| 422 | |
| 423 | /* |
| 424 | * err = resource_find_match(&anchor, &name, &unit, resname, value) |
no outgoing calls
no test coverage detected