aboutsummaryrefslogtreecommitdiff
path: root/sway/stringop.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-09-18 07:27:35 -0400
committerDrew DeVault <sir@cmpwn.com>2015-09-18 07:27:35 -0400
commit318e1be240574e316094e5ea73d32e9f9a1f7c04 (patch)
treeb93c54cba11fd92adb56dce49261d9adb88991fd /sway/stringop.c
parent8e25ce4e5763c74864587b0a78217eb20c299afe (diff)
Fix warnings introduced by prior commit
Diffstat (limited to 'sway/stringop.c')
-rw-r--r--sway/stringop.c8
1 files changed, 8 insertions, 0 deletions
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;
+}