Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor make adjustments, fix warnings #199

Merged
merged 3 commits into from Dec 16, 2016
Merged

Minor make adjustments, fix warnings #199

merged 3 commits into from Dec 16, 2016

Conversation

cjolivier01
Copy link
Member

No description provided.

LOG(FATAL) << "Need to set enviroment variable AWS_ACCESS_KEY_ID to use S3";
}
if (seckey == NULL) {
if (seckey == NULL || !*seckey) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mli is this correct?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will getenv return '\0'?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My implementation returns NULL (Ubuntu). However, the documentation is not specific on this and states that it returns NULL if the environment variable is not found. However, I can put an empty variable in the environment:
[coolivie@DEV:]export FOO=
[coolivie@DEV:
]env | grep FOO
FOO=
[coolivie@DEV:~]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By googling that, I see cases of some implementations returning an empty string.

Also, this example does not appear to check:
http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdlib/getenv.c?rev=1.19&content-type=text/x-cvsweb-markup

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok I'll merge this since it looks like it wouldn't hurt.

@piiswrong piiswrong merged commit f1f366b into dmlc:master Dec 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants