...
| Wiki Markup |
|---|
However, modifying the environment by using the {{setenv()}} or {{putenv()}} functions, or by any other means, may cause the environment memory to be reallocated, with the result that {{envp}} now references an incorrect location. For example, POSIX.1-2008 says the following \[[Austin Group 08|AA. C References#Austin Group 08]\] says the following. |
Unanticipated results may occur if
setenv()changes the external variableenviron. In particular, if the optionalenvpargument tomain()is present, it is not changed, and thus may point to an obsolete copy of the environment (as may any other copy ofenviron).
...