Age | Commit message (Collapse) | Author |
|
Since the result of localtime() is stored in a statically allocated
structure, data was overwritten when a context switch occurred during
(or shortly after) the execution of localtime(), potentially resulting
in critical data corruption. BUG#7 and BUG#8 are likely related.
This patch converts all usages of localtime() with localtime_r(), which
is thread-safe.
Reported-by: Baptiste Jonglez <baptiste@jonglez.org>
Reported-by: Erik Saule <esaule@bmi.osu.edu>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
When we only want to display a string at a specific place of the
screen, there's no need to use the more complex mvwprintw(), use
mvwaddstr() instead.
This should be slightly more efficient, and, above all, it prevents
weird things to happen if our string contains a '%', being interpreted
as an unwanted format string.
Signed-off-by: Baptiste Jonglez <baptiste--git@jonglez.org>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
The configuration options shown in the configuration menu are meant to
reflect the keys used in the configuration file. The descriptions
displayed alongside each option should be sufficient for non-English
speakers.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
Conflicts:
src/io.c
src/notify.c
src/utils.c
|
|
Convert our code base to adhere to Linux kernel coding style using
Lindent, with the following exceptions:
* Use spaces, instead of tabs, for indentation.
* Use 2-character indentations (instead of 8 characters).
Rationale: We currently have too much levels of indentation. Using
8-character tabs would make huge code parts unreadable. These need to be
cleaned up before we can switch to 8 characters.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
Make sure we actually copy the notification warning interval to the
correct buffer instead of printing it to stdout (using an arbitrary
format string). This makes sure the current warning interval is shown
when editing the field and also eliminates a potential format string
vulnerability.
Spotted with "-Wformat-nonliteral".
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
Rename the configuration options shown in the configuration dialogs to
match the new naming scheme used in the configuration file.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
Add the "const" keyword to parameters and variables that are never
modified. Most of these were spotted by "-Wwrite-strings".
We cast the second parameter to execvp() explicitly as it expects a
"char *const[]" where it should expect a "const char *const[]"
(according to the documentation, this is due to compatibility reasons).
This should be changed once we come up with a better solution.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
Translated strings returned by gettext() are statically allocated and
shouldn't be modified.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
Add 2012 to the copyright range for all source and documentation files.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
Translated strings returned by gettext() are statically allocated.
There's no need to copy them to a buffer, we can use the pointers
returned by gettext() instead.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
Conflicts:
src/calcurse.h
src/io.c
|
|
No reason to use "return (x);" here. Refer to the GNU coding guidelines
for details. Created using following semantic patch:
@@
expression expr;
@@
- return (expr);
+ return expr;
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
Use this constant everywhere when referring to a null pointer instead of
casting 0 to various types of pointers. Created using following semantic
patch:
@@
type type;
@@
- (type *)0
+ NULL
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
A small style fix that removes all remaining "(void)" casts. Using these
isn't encouraged in GNU coding guidelines and doesn't serve a certain
purpose, except for satisfying a few static code analysis tools. We
already nuked some of these in previous patches, but this semantic patch
should fix what's left:
@@
identifier func;
@@
- (void)func (
+ func (
...);
Long lines were re-formatted manually.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
Use one of the following functions where appropriate:
* puts() (whenever we print hard coded strings to stdout)
* fputs() (whenever we print hard coded strings to a stream)
* putchar() (whenever we print a single character to stdout)
* fputc() (whenever we print a single character to a stream)
* strncpy() (whenever we copy hard coded strings to a buffer)
This removes the overhead introduced by the format string parser and
reduces the number of false positive C-format strings spotted by
xgettext(1)'s heuristics.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
Rename recur_*_inday() to recur_*_find_occurrence() and use the new
functions whenever we actually care about the start time of an
occurrence.
Reintroduce recur_*_inday() as wrappers to recur_*_find_occurrence() and
pass NULL as start time buffer (which means "skip start time
calculation"). Keep using these when we only want to know if a recurrent
item belongs to a specific day but do not care about the actual start
time.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
Having item's durations eventually allows for better parsing of
recurrent appointments as we might be interested in how many days are
covered by a multi-day appointment.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
Always invoke pthread_join() when we blow up a thread via
pthread_cancel() (avoid zombie threads).
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
If "notify-all" is enabled, all non-flagged appointments will be
notified (instead of flagged ones). This is useful for users that want
to be notified of everything.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
Remove the "current_time" check from the first if condition. As "greater
than" relations (">") have higher precedence than assignments ("=") in
C, this caused "real_app_time" to always be one or zero which definitely
isn't what we want here. Reading further down, it turns out that we
don't even need this comparison here, so we should be fine removing it.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
This allows to force notify_check_next_app() to update the notification
appointment, even if start times are equal (e.g. if the item description
was changed).
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
Use a global flag to record whether the terminal was resized instead of
redrawing everything each time a KEY_RESIZE is read.
Add some additional checks to help_write_pad() as invalid actions may be
passed now due to using signals instead of virtual key presses.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
* Update copyright dates (use 2004-2011 as date range everywhere).
* Change copyright holder from "Frederic Culot" to "calcurse Development
Team".
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
Rename "days" structure to "excp" which seems to be a better name here.
Use generic linked lists of excp structures instead of using the "days"
structure which again contains a linked list implementation. Do some
cleanups and invocation fixes.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
Use spaces instead of tabs for source code indentation only, strip
trailing whitespaces from lines.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
|
|
|
|
|
|
|
|
thanks.
|
|
flag its appointment.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
thread was launched (thanks Jan for reporting this)
|
|
|
|
|
|
memory usage
|
|
|