| 343 | |
| 344 | size_t index = 0; |
| 345 | foreachpair ( |
| 346 | const std::string& key, |
| 347 | const std::string& value, environment.get()) { |
| 348 | std::string entry = key + "=" + value; |
| 349 | envp[index] = new char[entry.size() + 1]; |
| 350 | strncpy(envp[index], entry.c_str(), entry.size() + 1); |
| 351 | ++index; |
| 352 | } |
| 353 | |
| 354 | envp[index] = nullptr; |
| 355 | } |