mirror of https://github.com/fairyglade/ly.git
Fixed all of the segmentation errors due to not formatting bigclock while bigclock in on
This commit is contained in:
parent
30e08501b7
commit
fdb6592cae
|
|
@ -275,7 +275,7 @@ void config_defaults()
|
|||
config.asterisk = '*';
|
||||
config.bg = 0;
|
||||
config.bigclock = false;
|
||||
config.bigclock_format = "%H:%M";
|
||||
config.bigclock_format = NULL;
|
||||
config.blank_box = true;
|
||||
config.blank_password = false;
|
||||
config.clock = NULL;
|
||||
|
|
|
|||
|
|
@ -240,11 +240,15 @@ void alpha_blit(struct tb_cell* buf, uint16_t x, uint16_t y, uint16_t w, uint16_
|
|||
|
||||
void draw_bigclock(struct term_buf* buf)
|
||||
{
|
||||
if (!config.bigclock || strlen(config.bigclock_format)==0)
|
||||
if (!config.bigclock)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(config.bigclock_format==NULL){
|
||||
config.bigclock_format = "%H:%M";
|
||||
}
|
||||
|
||||
int bigclocklength = strlen(config.bigclock_format);
|
||||
int xo = (buf->width / 2) - bigclocklength * (CLOCK_W+1) / 2;
|
||||
int yo = (buf->height - buf->box_height) / 2 - CLOCK_H - 2;
|
||||
|
|
|
|||
Loading…
Reference in New Issue