summaryrefslogtreecommitdiff
path: root/sway/stringop.c
diff options
context:
space:
mode:
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;
+}