Skip to content

Commit

Permalink
fix warning windows
Browse files Browse the repository at this point in the history
  • Loading branch information
waahm7 committed Aug 5, 2024
1 parent 4d2fb12 commit e5e7776
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions source/windows/environment.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,15 @@
#include <stdlib.h>

struct aws_string *aws_get_env(struct aws_allocator *allocator, const char *name) {

#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable : 4996)
#endif
const char *value = getenv(name);
#ifdef _MSC_VER
# pragma warning(pop)
#endif

if (value == NULL) {
return NULL;
}
Expand All @@ -19,8 +26,15 @@ struct aws_string *aws_get_env(struct aws_allocator *allocator, const char *name
}

struct aws_string *aws_get_env_nonempty(struct aws_allocator *allocator, const char *name) {

#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable : 4996)
#endif
const char *value = getenv(name);
#ifdef _MSC_VER
# pragma warning(pop)
#endif

if (value == NULL || value[0] == '\0') {
return NULL;
}
Expand Down

0 comments on commit e5e7776

Please sign in to comment.