Fix SHA1 calculation of long notes

sha1_update() modifies the input data, so we need to duplicate the input
before calculating the hash. Otherwise, input data longer than 64 bytes
will be garbled.

Reported-by: Hakan Jerning <jerning@home.se>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Define _DARWIN_C_SOURCE to get SIGWINCH on OS X

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
ical.c: Remove newlines from item summaries

Newline characters are not allowed in calcurse item descriptions.
Replace any newlines in iCal summary lines with spaces.

Fixes GitHub issue #6.

Reported-by: Jonathan McCrohan <jmccrohan@gmail.com>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Make sure that tmppath is always NULL-terminated

Fixes GitHub issue #5.

Reported-by: dcb314
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>