aboutsummaryrefslogtreecommitdiff
path: root/attributes.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-06-25 15:25:45 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-06-25 15:25:45 +0000
commit32398b98a8735dfc7a53b1ab2f748c15f0e69881 (patch)
treef479be89914bc58dff8fb46af0252761c23a747f /attributes.c
parent0fdd47660a1b3b1014292e0b28a4ae20a642776d (diff)
downloadrtmux-32398b98a8735dfc7a53b1ab2f748c15f0e69881.tar.gz
rtmux-32398b98a8735dfc7a53b1ab2f748c15f0e69881.tar.bz2
rtmux-32398b98a8735dfc7a53b1ab2f748c15f0e69881.zip
Sync to OpenBSD: fixes from ray@.
Diffstat (limited to 'attributes.c')
-rw-r--r--attributes.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/attributes.c b/attributes.c
index 24744481..259b7434 100644
--- a/attributes.c
+++ b/attributes.c
@@ -1,4 +1,4 @@
-/* $Id: attributes.c,v 1.1 2009-01-27 20:22:33 nicm Exp $ */
+/* $Id: attributes.c,v 1.2 2009-06-25 15:25:45 nicm Exp $ */
/*
* Copyright (c) 2009 Joshua Elsasser <josh@elsasser.org>
@@ -45,7 +45,8 @@ attributes_tostring(u_char ch)
strlcat(buf, "hidden,", sizeof (buf));
if (ch & GRID_ATTR_ITALICS)
strlcat(buf, "italics,", sizeof (buf));
- *(strrchr(buf, ',')) = '\0';
+ if (*buf)
+ *(strrchr(buf, ',')) = '\0';
return (buf);
}