diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-05-25 08:41:01 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-25 08:41:01 -0400 |
commit | a268a0c2ae9dcad918eae44bd325dc21977ac3fc (patch) | |
tree | 40eca41d98740ba8aa0065c50712c33b32a44595 /common | |
parent | 95cc84bd950f7c057a15f65d477462b5cc9527d2 (diff) | |
parent | db38b9bbf3cce4083c538209a7ce5ef1a1cf5f3f (diff) | |
download | sway-a268a0c2ae9dcad918eae44bd325dc21977ac3fc.tar.xz |
Merge pull request #2034 from RyanDwyer/cleanup-container-titles
Clean up container title functions
Diffstat (limited to 'common')
-rw-r--r-- | common/stringop.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/common/stringop.c b/common/stringop.c index 4a37543d..d9ae9925 100644 --- a/common/stringop.c +++ b/common/stringop.c @@ -55,6 +55,20 @@ void strip_quotes(char *str) { *end = '\0'; } +char *lenient_strcat(char *dest, const char *src) { + if (dest && src) { + return strcat(dest, src); + } + return dest; +} + +char *lenient_strncat(char *dest, const char *src, size_t len) { + if (dest && src) { + return strncat(dest, src, len); + } + return dest; +} + // strcmp that also handles null pointers. int lenient_strcmp(char *a, char *b) { if (a == b) { |