summaryrefslogtreecommitdiff
path: root/i3status.c
diff options
context:
space:
mode:
authorEmeric Planet <emeric.planet@datadoghq.com>2017-12-11 11:38:31 +0100
committerMichael Stapelberg <stapelberg@users.noreply.github.com>2017-12-11 11:38:31 +0100
commit53fb9b4f18cd9ee3a64be5084ccc76aeea279515 (patch)
tree7e87969fb73094b851f037c8fae3547ec579df46 /i3status.c
parentc3424e10bee91a4e0f21e7f0b72975e938e3f501 (diff)
Add IPv6 address when IPv4 isn't available (#247)
Diffstat (limited to 'i3status.c')
-rw-r--r--i3status.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/i3status.c b/i3status.c
index 558f8ab..2cded06 100644
--- a/i3status.c
+++ b/i3status.c
@@ -111,6 +111,9 @@ static void *scalloc(size_t size) {
}
char *sstrdup(const char *str) {
+ if (str == NULL) {
+ return NULL;
+ }
char *result = strdup(str);
exit_if_null(result, "Error: out of memory (strdup())\n");
return result;