Index: /trunk/psLib/src/db/psDB.c
===================================================================
--- /trunk/psLib/src/db/psDB.c	(revision 8525)
+++ /trunk/psLib/src/db/psDB.c	(revision 8526)
@@ -12,6 +12,6 @@
  *  @author Joshua Hoblitt
  *
- *  @version $Revision: 1.84 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-08-22 02:41:22 $
+ *  @version $Revision: 1.85 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-08-23 23:23:13 $
  *
  *  Copyright (C) 2005-2006  Joshua Hoblitt, University of Hawaii
@@ -2125,10 +2125,10 @@
 static char *psDBIntToString(psU64 n)
 {
-    // length of string + \0
+    // length of string (log10 + 1) + \0
     // if n is 0, length is 1 char + \0
-    size_t length = n ? (size_t)log10((double)n) + 1
+    size_t length = n ? (size_t)log10((double)n) + 1 + 1
                     : 2;
     char *string = psAlloc(length);
-    sprintf(string, "%li", (long int)n);
+    snprintf(string, length, "%li", (long int)n);
 
     return string;
