Wiki Markup |
---|
Do not modify the value returned by the {{getenv()}} function. Create a copy and make your changes locally, so that they are not overwritten. According to C99 \[[ISO/IEC 9899-:1999|AA. C References#ISO/IEC 9899-1999]\]: |
The
getenv
function returns a pointer to a string associated with the matched list member. The string pointed to shall not be modified by the program, but may be overwritten by a subsequent call to thegetenv
function. If the specified name cannot be found, a NULL null pointer is returned.
Non-Compliant Code Example
...
Wiki Markup |
---|
\[[ISO/IEC 9899-:1999|AA. C References#ISO/IEC 9899-1999]\] Section 7.20.4.5, "The {{getenv}} function" \[[Open Group 04|AA. C References#Open Group 04]\] [getenv|http://www.opengroup.org/onlinepubs/000095399/functions/getenv.html] |
...