summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2016-04-10 14:34:25 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2016-04-10 14:34:25 +0200
commitfe6bc99b1ed59c428ffe5da44eafcf3712d3d80d (patch)
treebbb97fbcb82f40fae9dd432107333a68f36aded2
parent389af9187013e76036e48369276582c55bcbc849 (diff)
add comment for strtotime
-rw-r--r--util.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/util.c b/util.c
index b75c88c..c525def 100644
--- a/util.c
+++ b/util.c
@@ -214,7 +214,7 @@ parseline(char *line, char *fields[FieldLast])
return i;
}
-/* Parse time to time_t, assumes time_t is signed. */
+/* Parse time to time_t, assumes time_t is signed, ignores fractions. */
int
strtotime(const char *s, time_t *t)
{
@@ -225,6 +225,8 @@ strtotime(const char *s, time_t *t)
l = strtoll(s, &e, 10);
if (errno || *s == '\0' || *e)
return -1;
+ /* NOTE: assumes time_t is 64-bit on 64-bit platforms:
+ long long (atleast 32-bit) to time_t. */
if (t)
*t = (time_t)l;