]> jfr.im git - irc/evilnet/x3.git/blobdiff - src/tools.c
Improved and committed the Life4Christ folks aut-oper patch.
[irc/evilnet/x3.git] / src / tools.c
index a7782071cbd972ee4d274496336819943dd92148..d9fd7c0e9cd49fbb0fbfb18794a16ea0b9265e3b 100644 (file)
@@ -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)
 {