mirror of
https://repo.or.cz/socat.git
synced 2025-07-03 20:16:32 +00:00
socat crashed on systems without setenv()
This commit is contained in:
parent
7c2039ada8
commit
a479ab8df5
3 changed files with 6 additions and 2 deletions
2
utils.c
2
utils.c
|
@ -75,7 +75,7 @@ int setenv(const char *name, const char *value, int overwrite) {
|
|||
if (!overwrite) {
|
||||
if (getenv(name)) return 0; /* already exists */
|
||||
}
|
||||
if ((env = Malloc(strlen(name)+strlen(value)+2)) != NULL) {
|
||||
if ((env = Malloc(strlen(name)+strlen(value)+2)) == NULL) {
|
||||
return -1;
|
||||
}
|
||||
sprintf(env, "%s=%s", name, value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue