diff options
author | William Pettersson <william.pettersson@gmail.com> | 2012-10-07 20:30:12 +1000 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2012-11-18 20:10:45 +0100 |
commit | 65dc58466260320303c7af8c5c8a8bfe3b0802c8 (patch) | |
tree | 2a1c04fcff360c0f70ccf2a3c2c630761cc9be98 /src/utils.c | |
parent | 7e7987575a4d5228137dba649813307c381c5034 (diff) | |
download | calcurse-65dc58466260320303c7af8c5c8a8bfe3b0802c8.zip |
Add support for entering times in 24 hour format
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/utils.c')
-rw-r--r-- | src/utils.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/utils.c b/src/utils.c index 3e86f17..2ca35de 100644 --- a/src/utils.c +++ b/src/utils.c @@ -740,9 +740,11 @@ int parse_time(const char *string, unsigned *hour, unsigned *minute) if (*p == ':') { if ((++n) > 1) return 0; - } else if ((*p >= '0') && (*p <= '9')) + } else if ((*p >= '0') && (*p <= '9')) { + if ((n == 0) && (p == (string + 2)) && *(p + 1)) + n++; in[n] = in[n] * 10 + (int)(*p - '0'); - else + } else return 0; } |