Commit 38e0cf16 authored by Projects's avatar Projects

Time settings fix.

parent 06d30f35
...@@ -76,7 +76,9 @@ static inline char sb_digit(int idx) ...@@ -76,7 +76,9 @@ static inline char sb_digit(int idx)
// Checks if spinboxes contain correct values // Checks if spinboxes contain correct values
static bool is_valid(void) static bool is_valid(void)
{ {
return (sb_digit(H1) < 3 && sb_digit(H2) < 5 && sb_digit(M1) < 6); int hour = sb_digit(H1) * 10 + sb_digit(H2);
int min = sb_digit(M1) * 10 + sb_digit(M2);
return (hour >= 0 && hour <= 23 && min >= 0 && min <= 59);
} }
// Sets the hour from spinboxes to clock // Sets the hour from spinboxes to clock
......
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
#include <string.h> #include <string.h>
// Default character sets. // Default character sets.
const char *char_digits = "0123456789\x0"; const char *char_digits = "0123456789";
const char *char_letters = "abcdefghijklmnopqrstuvwxyz\0"; const char *char_letters = "abcdefghijklmnopqrstuvwxyz";
static void spinbox_event(struct ui_widget *w, const struct event *evt) static void spinbox_event(struct ui_widget *w, const struct event *evt)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment