...
Code Block | ||
---|---|---|
| ||
const char *env;
char *copy_of_env;
if ((env = getenv("TEST_ENV")) != NULL) {
copy_of_env = (char *)malloc(strlen(env) + 1);
if (copy_of_env != NULL) {
strcpy(copy_of_env, env);
}
else {
/* Error handling */
}
copy_of_env[0] = 'a';
}
|
...