aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-04-22 01:58:23 +0200
committerHugo Hörnquist <hugo@hornquist.se>2019-04-22 01:58:23 +0200
commit36a59f0d21f8b32fd1095b14d523f99a76cff726 (patch)
tree283726a8fde89dcd323b9ed9456c5ab716793b7d
parentFix DTEND of timezoned events. (diff)
downloadcalp-36a59f0d21f8b32fd1095b14d523f99a76cff726.tar.gz
calp-36a59f0d21f8b32fd1095b14d523f99a76cff726.tar.xz
Remove trailing newline from color.
-rw-r--r--src/calendar.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/calendar.c b/src/calendar.c
index 5ec2b91d..b437d98d 100644
--- a/src/calendar.c
+++ b/src/calendar.c
@@ -85,6 +85,9 @@ int handle_dir(vcomponent* cal, char* path) {
if (strcmp (d->d_name, "color") == 0) {
f = fopen(resolved_path, "r");
fgets(info_buf, 0x100, f);
+ if (info_buf[strlen(info_buf) - 1] == '\n')
+ info_buf[strlen(info_buf) - 1] = '\0';
+
fclose(f);
vcomponent_push_val(cal, "COLOR", info_buf);
} else if (strcmp (d->d_name, "displayname") == 0) {