diff options
Diffstat (limited to 'sway/stringop.c')
-rw-r--r-- | sway/stringop.c | 8 |
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) { | |||
311 | 311 | ||
312 | return res; | 312 | return res; |
313 | } | 313 | } |
314 | |||
315 | char *strdup(const char *str) { | ||
316 | char *dup = malloc(strlen(str) + 1); | ||
317 | if (dup) { | ||
318 | strcpy(dup, str); | ||
319 | } | ||
320 | return dup; | ||
321 | } | ||