X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/blobdiff_plain/de9510bcaba3fc0377e09259f8b49921c421d269..639bdb1d287235b147d36acb79a0b608e5fca0af:/src/tools.c diff --git a/src/tools.c b/src/tools.c index a778207..d9fd7c0 100644 --- a/src/tools.c +++ b/src/tools.c @@ -588,7 +588,7 @@ TypeLength(char type) { switch (type) { case 'y': return 365*24*60*60; - case 'M': return 31*24*60*60; + case 'M': return 30*24*60*60; case 'w': return 7*24*60*60; case 'd': return 24*60*60; case 'h': return 60*60; @@ -598,6 +598,10 @@ TypeLength(char type) } } +/* This function is not entirely accurate as it does not take into account leap units + * or varying months. TODO: use proper dateadd functions to calculate real seconds + * from now for the units (eg 1M should be give us seconds till todays date next month) + */ unsigned long ParseInterval(const char *interval) { @@ -935,7 +939,7 @@ tools_cleanup(void) * multiple dilimiters, which can really * offset tokens and cause huge corruption * so this function will use strsep but - * act like strtok in that sence. + * act like strtok in that sense. */ char *mysep(char **sepstr, char *delim) {