mirror of
https://github.com/moparisthebest/socat
synced 2024-12-22 06:58:47 -05:00
socat crashed on systems without setenv()
This commit is contained in:
parent
7c2039ada8
commit
a479ab8df5
4
CHANGES
4
CHANGES
@ -1,4 +1,8 @@
|
|||||||
|
|
||||||
|
corrections:
|
||||||
|
socat crashed on systems without setenv() (esp. SunOS up to Solaris 9);
|
||||||
|
thanks to Todd Stansell for reporting this bug
|
||||||
|
|
||||||
####################### V 1.7.1.0:
|
####################### V 1.7.1.0:
|
||||||
|
|
||||||
new features:
|
new features:
|
||||||
|
2
utils.c
2
utils.c
@ -75,7 +75,7 @@ int setenv(const char *name, const char *value, int overwrite) {
|
|||||||
if (!overwrite) {
|
if (!overwrite) {
|
||||||
if (getenv(name)) return 0; /* already exists */
|
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;
|
return -1;
|
||||||
}
|
}
|
||||||
sprintf(env, "%s=%s", name, value);
|
sprintf(env, "%s=%s", name, value);
|
||||||
|
Loading…
Reference in New Issue
Block a user