diff options
author | 2018-05-25 08:41:01 -0400 | |
---|---|---|
committer | 2018-05-25 08:41:01 -0400 | |
commit | a268a0c2ae9dcad918eae44bd325dc21977ac3fc (patch) | |
tree | 40eca41d98740ba8aa0065c50712c33b32a44595 /common | |
parent | Merge pull request #2035 from RyanDwyer/fix-focus-bug (diff) | |
parent | Clean up container title functions (diff) | |
download | sway-a268a0c2ae9dcad918eae44bd325dc21977ac3fc.tar.gz sway-a268a0c2ae9dcad918eae44bd325dc21977ac3fc.tar.zst sway-a268a0c2ae9dcad918eae44bd325dc21977ac3fc.zip |
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) { | |||
55 | *end = '\0'; | 55 | *end = '\0'; |
56 | } | 56 | } |
57 | 57 | ||
58 | char *lenient_strcat(char *dest, const char *src) { | ||
59 | if (dest && src) { | ||
60 | return strcat(dest, src); | ||
61 | } | ||
62 | return dest; | ||
63 | } | ||
64 | |||
65 | char *lenient_strncat(char *dest, const char *src, size_t len) { | ||
66 | if (dest && src) { | ||
67 | return strncat(dest, src, len); | ||
68 | } | ||
69 | return dest; | ||
70 | } | ||
71 | |||
58 | // strcmp that also handles null pointers. | 72 | // strcmp that also handles null pointers. |
59 | int lenient_strcmp(char *a, char *b) { | 73 | int lenient_strcmp(char *a, char *b) { |
60 | if (a == b) { | 74 | if (a == b) { |