Fix an inverted test csae. Success of getenv() is determined by a return

value of !NUL rather than NUL.

Submitted by:	luigi
Pointy hat to:	jhb
This commit is contained in:
John Baldwin 2001-10-25 17:22:31 +00:00
parent dd1eb0f437
commit 5a08b84f83

View File

@ -76,7 +76,7 @@ getenv_string(const char *name, char *data, int size)
char *tmp;
tmp = getenv(name);
if (tmp == NULL) {
if (tmp != NULL) {
strncpy(data, tmp, size);
data[size - 1] = 0;
return (1);