From 318e1be240574e316094e5ea73d32e9f9a1f7c04 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 18 Sep 2015 07:27:35 -0400 Subject: Fix warnings introduced by prior commit --- sway/stringop.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sway/stringop.c') diff --git a/sway/stringop.c b/sway/stringop.c index 191e40c8..7a2c8317 100644 --- a/sway/stringop.c +++ b/sway/stringop.c @@ -311,3 +311,11 @@ char *join_list(list_t *list, char *separator) { return res; } + +char *strdup(const char *str) { + char *dup = malloc(strlen(str) + 1); + if (dup) { + strcpy(dup, str); + } + return dup; +} -- cgit v1.2.3