3 > Calcurse is nice program - i like this program, but i find bug:
5 > if lenght one entry in file ~/.calcurse/apts (Appointments) > 256 then i
6 > see error in execute program:
11 enclosed you will find an updated version that should fix the bug you mention.
12 Actually this is a quick fix (I am very busy at work right now so it is
13 difficult to spend time on calcurse...). Anyway, if you want to send me a
14 better patch I would be happy to include it in next stable release. The
15 function to update is apoint_scan (file apoint.c): the item should be loaded
16 into a dynamically allocated string, whereas for now on it is just a fixed
19 Please tell me if the enclosed version fixes your problem, and many thanks for
20 your bug report. Do not hesitate to contact me if you find other bugs!
25 diff -Naur calcurse-2.5/src/apoint.c calcurse-2.5.new/src/apoint.c
26 --- calcurse-2.5/src/apoint.c 2009-01-03 22:32:11.000000000 +0100
27 +++ calcurse-2.5.new/src/apoint.c 2009-05-22 21:40:33.000000000 +0200
30 apoint_scan (FILE *f, struct tm start, struct tm end, char state, char *note)
32 - char buf[MESG_MAXSIZE], *newline;
33 + char buf[BUFSIZ], *newline;
34 time_t tstart, tend, t;
39 /* Read the appointment description */
40 - (void)fgets (buf, MESG_MAXSIZE, f);
41 + (void)fgets (buf, sizeof buf, f);
42 newline = strchr (buf, '\n');
45 diff -Naur calcurse-2.5/src/apoint.h calcurse-2.5.new/src/apoint.h
46 --- calcurse-2.5/src/apoint.h 2009-01-03 22:32:11.000000000 +0100
47 +++ calcurse-2.5.new/src/apoint.h 2009-05-22 21:44:42.000000000 +0200
52 -#define MESG_MAXSIZE 256
54 #define APOINT_NULL 0x0
55 #define APOINT_NOTIFY 0x1 /* Item needs to be notified */
56 diff -Naur calcurse-2.5/src/event.c calcurse-2.5.new/src/event.c
57 --- calcurse-2.5/src/event.c 2009-01-03 22:32:11.000000000 +0100
58 +++ calcurse-2.5.new/src/event.c 2009-05-22 21:45:30.000000000 +0200
61 event_scan (FILE *f, struct tm start, int id, char *note)
63 - char buf[MESG_MAXSIZE], *nl;
64 + char buf[BUFSIZ], *nl;
70 /* Read the event description */
71 - (void)fgets (buf, MESG_MAXSIZE, f);
72 + (void)fgets (buf, sizeof buf, f);
73 nl = strchr (buf, '\n');
76 diff -Naur calcurse-2.5/src/event.h calcurse-2.5.new/src/event.h
77 --- calcurse-2.5/src/event.h 2009-01-03 22:32:11.000000000 +0100
78 +++ calcurse-2.5.new/src/event.h 2009-05-22 21:45:35.000000000 +0200
83 -#define MESG_MAXSIZE 256
87 diff -Naur calcurse-2.5/src/recur.c calcurse-2.5.new/src/recur.c
88 --- calcurse-2.5/src/recur.c 2009-01-03 22:32:11.000000000 +0100
89 +++ calcurse-2.5.new/src/recur.c 2009-05-22 21:46:07.000000000 +0200
94 - char buf[MESG_MAXSIZE], *nl;
95 + char buf[BUFSIZ], *nl;
96 time_t tstart, tend, t, tuntil;
101 /* Read the appointment description */
102 - (void)fgets (buf, MESG_MAXSIZE, f);
103 + (void)fgets (buf, sizeof buf, f);
104 nl = strchr (buf, '\n');
107 @@ -462,11 +462,11 @@
108 recur_event_scan (FILE *f, struct tm start, int id, char type, int freq,
109 struct tm until, char *note, struct days_s **exc)
111 - char buf[MESG_MAXSIZE], *nl;
112 + char buf[BUFSIZ], *nl;
113 time_t tstart, tuntil;
115 /* Read the event description */
116 - (void)fgets (buf, MESG_MAXSIZE, f);
117 + (void)fgets (buf, sizeof buf, f);
118 nl = strchr (buf, '\n');