Fixed 64 bit count. Version 1.3.20.
[cocanwiki.git] / scripts / admin / host.ml
index 4cec09c..8625632 100644 (file)
@@ -1,7 +1,7 @@
 (* COCANWIKI - a wiki written in Objective CAML.
  * Written by Richard W.M. Jones <rich@merjis.com>.
  * Copyright (C) 2004 Merjis Ltd.
- * $Id: host.ml,v 1.7 2004/10/21 19:54:29 rich Exp $
+ * $Id: host.ml,v 1.8 2005/12/05 10:07:45 rich Exp $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -55,14 +55,17 @@ let run r (q : cgi) (dbh : Dbi.connection) _ _ _ =
     match sth#fetch1 () with
        [ `String canonical_hostname;
          `Bool has_css;
-         (`Null | `Int _) as page_count; (`Null | `Int _) as total_count;
+         (`Null | `Int _ | `Int64 _) as page_count;
+          (`Null | `Int _ | `Int64 _) as total_count;
          (`Null | `Timestamp _) as last_modified_date;
          (`Null | `Timestamp _) as creation_date ] ->
          let page_count = match page_count with
              `Null -> 0
+           | `Int64 n -> Int64.to_int n
            | `Int n -> n in
          let total_count = match total_count with
              `Null -> 0
+            | `Int64 n -> Int64.to_int n
            | `Int n -> n in
          let last_modified_date = match last_modified_date with
              `Null -> ""
@@ -72,7 +75,7 @@ let run r (q : cgi) (dbh : Dbi.connection) _ _ _ =
            | `Timestamp t -> printable_date t in
          canonical_hostname, has_css, page_count, total_count,
          last_modified_date, creation_date
-      | _ -> assert false in
+      | xs -> failwith (Dbi.sdebug xs) in
 
   template#set "canonical_hostname" canonical_hostname;
   template#conditional "has_css" has_css;