Sergei Trofimovich
4cfd73080d
ttyclock.c: always use "%s"-style format for printf()-style functions
...
`ncuses-6.3` added printf-style function attributes and now makes
it easier to catch cases when user input is used in palce of format
string when built with CFLAGS=-Werror=format-security:
ttyclock.c:270:71: error: format not a string literal and no format arguments [-Werror=format-security]
270 | mvwprintw(ttyclock.datewin, (DATEWINH / 2), 1, ttyclock.date.datestr);
| ~~~~~~~~~~~~~^~~~~~~~
Let's wrap all the missing places with "%s" format.
4 years ago
aboven
84fd64b77c
Update window when date string change
5 years ago
Jeremie Francois (on omega)
08f457257b
Allow external locale (github #66 )
5 years ago
Jakub Wilk
2b79d36ff0
Use standard bool type
6 years ago
Jakub Wilk
b24d49fc3c
Get rid of unsafe SIGWINCH handler
...
The SIGWINCH signal handler was not async-signal-safe.
This could cause memory corruption if the signal was delivered at an
inopportune moment.
Rely on ncurses' builtin SIGWINCH signal handler instead.
6 years ago
Jakub Wilk
542016a26b
React to keyboard input without delay
6 years ago
Jakub Wilk
4c1ee2e66b
Fix comment placement
6 years ago
Jakub Wilk
b20b5c9158
Fix typo
6 years ago
Jakub Wilk
aab718ad40
Fix uneven indentation
6 years ago
Jakub Wilk
e20a6efebd
Update vim modelines to better match reality
6 years ago
Sanchith Hegde
f2a79ca51f
Fixes AM/PM displayed incorrectly for 12:00 - 12:59
7 years ago
David Demelier
767f4b948f
Avoid allocating on the heap
...
The ttyclock structure is small enough to be kept on the stack rather
than allocating it on the heap.
7 years ago
Slackhead
75ca275408
Fix mixed indents and trailing whitespace ( #56 )
...
This fixes the tabs and trailing whitespace.
I've set a vim modeline to expand tabs and set tab width to 4 spaces.
8 years ago
Slackhead
b798e9cf24
AM/PM Fix
8 years ago
Yu-Jie Lin
94c2d0c5b7
update and fix copyright years
8 years ago
Vlad Glagolev
b146b15156
Do not display date box when '-D' flag is provided
8 years ago
Antoine Beaupré
59f358fd0f
set time structure at the right moment
...
the way this was working before, we would populate the ttyclock->lt
field *after* fetching the ttyclock->tm structure, which means that
would get the `localtime` of the *previous* iteration. this created a
one second delay in the clock display that was, I believe,
unintentional. this accounts for part of the 2s delay when compared to
other clocks like vtclock or xclock.
Closes : #40
9 years ago
Wessels
c1490a1122
match original indentation
11 years ago
Wessels
e844687f88
Make both colons blink when -s (seconds) enabled and simplify the
...
logic by setting a variable for the dot color.
11 years ago
Christian Gießen
6fc660a23e
removed a duplicate line in the usage text
13 years ago
Grey
35eab7950d
Implemented delay in seconds for lower CPU usage
13 years ago
Paul Tagliamonte
85f41f16a1
Add the f argument to optparse to avoid segfault.
...
Otherwise optarg is set to 0, and we segfault when we
try to strcpy it.
13 years ago
Justin Hammond
6ff646f569
Added utc option
13 years ago
Brian Cain
ad835677bc
(maint) Add blink colon option
...
Prior to this commit, my blinking colon pull req made blinking default.
This commit makes it so that you have to pass in a flag -B to make the
colons blink. This fits with the style of this program.
13 years ago
briancain
aefad0a773
Fix code logic
...
Cleaning up code logic
13 years ago
briancain
61b720558e
Add blinking curser
...
The : now blinks like a real digital clock
13 years ago
Christian Gießen
6e9d5ba273
fixed a typo
13 years ago
Christian Gießen
8eb31f58e5
added bold colors and removed the frame
13 years ago
Clemens Fuchslocher
569ede8659
Added date option.
13 years ago
Carla Valenti
6607fc1a63
* Add the -T <tty> and -n options to facilitate use
...
through inittab(5)
* Update and fix the man page.
* Adjust default date format which was left over from a previous
failed merge.
15 years ago
Carla Valenti
2b4bf01a28
* Fix -f <format> and avoid related SIGSEGV
...
* Remove free'd pointer indirections and move cleanup code to
own fuction.
15 years ago
Skami18
2f2aaa09a0
Added the screensaver mode
15 years ago
Guenter Knauf
df64a7fbb2
Added -d to program usage outout and to README.
16 years ago
Guenter Knauf
4644b63064
Changed default date format.
...
In order to avoid mixing up day and month its better to use %F
(the ISO 8601 date format) to be more international understandable.
16 years ago
Guenter Knauf
da6985db9d
Fixed segfault with now non-working -f option.
...
The commit to add the -d option broke getopt for -f taking an argument.
16 years ago
Benoît Zugmeyer
ab96db2e4e
Correct format specification bug
16 years ago
Benoît Zugmeyer
8502f635db
Press 'b' to switch box on/off
16 years ago
Benoît Zugmeyer
3594e6276b
Add option (-b) to show border, default not shown
16 years ago
Guillaume B
a82fd71690
Added the "-d" option.
...
It provides the user the ability to set the clock redraw frequency at
runtime.
17 years ago
Guillaume B
55038fd7c1
Corrected minor stuff about the animation.
17 years ago
Guillaume B
01c5b4424c
Removed halfdelay and fixed some stuff about the animation.
17 years ago
Martin Duquesnoy
68afd752e3
Re-Add meridiem sign to date string and fix help page
17 years ago
Martin Duquesnoy
a32ee816f7
Improve color switch thing
17 years ago
Martin Duquesnoy
c8593cd0a7
Add keybind [0;7] to change color!
17 years ago
Martin Duquesnoy
695a33a74f
Add -C option to choose clock color
17 years ago
Martin Duquesnoy
f13dc1490d
Remove full argument, fix typo and alloc
17 years ago
Martin Duquesnoy
e7a243b934
Fix typo.
17 years ago
Tom Adams
f119cd20b0
Added option to change date format.
17 years ago
Tom Adams
d2459f135a
Use strftime for the date.
17 years ago
Martin Duquesnoy
742224bb71
Adjuste second mode position when it's switching and if the clock is show out the term
17 years ago