| 443 | #endif |
| 444 | |
| 445 | void set_env_str(const char *var, const char *str) |
| 446 | { |
| 447 | #ifdef HAVE_SETENV |
| 448 | if (setenv(var, str, 1) < 0) |
| 449 | out_of_memory("set_env_str"); |
| 450 | #else |
| 451 | #ifdef HAVE_PUTENV |
| 452 | char *mem; |
| 453 | if (asprintf(&mem, "%s=%s", var, str) < 0) |
| 454 | out_of_memory("set_env_str"); |
| 455 | putenv(mem); |
| 456 | #else |
| 457 | (void)var; |
| 458 | (void)str; |
| 459 | #endif |
| 460 | #endif |
| 461 | } |
| 462 | |
| 463 | #if defined HAVE_SETENV || defined HAVE_PUTENV |
| 464 |
no test coverage detected