diff options
author | Jonathan McCrohan <jmccrohan@gmail.com> | 2012-02-05 19:06:21 +0000 |
---|---|---|
committer | Jonathan McCrohan <jmccrohan@gmail.com> | 2012-02-05 19:06:21 +0000 |
commit | 4aa11b915e718d739d7bbfc737b77164d79af116 (patch) | |
tree | 4cd88e5cca9df66f069a2eb1b639ec0ad938948c /ui.c | |
parent | c93ad1a4ef2625ffb849b8868fe32f930594ac70 (diff) | |
parent | f3410da7f0bd208a5f2d792131b215454e782e93 (diff) | |
download | wavemon-4aa11b915e718d739d7bbfc737b77164d79af116.tar.gz |
Resolve 0.7.3 import conflict
Diffstat (limited to '')
-rw-r--r-- | ui.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -84,12 +84,16 @@ const char *curtail(const char *str, const char *sep, int len) const char fallback_sep[] = "~"; int l = 0, front, mid, back; - assert(len < sizeof(out_buf)); + if (len >= sizeof(out_buf)) + len = sizeof(out_buf) - 1; - if (sep == NULL) + if (sep == NULL || *sep == '\0') sep = fallback_sep; mid = strlen(sep); - assert(len >= mid); + if (mid > len) { + sep = fallback_sep; + mid = strlen(sep); + } if (str != NULL) l = strlen(str); |