On Jan 7, 2004, at 6:30 AM, Brandon Weisz wrote:
Just for testing, I changed 000 "#ffffff" to 000 "#000000" in the colortable file. The html was truncated again (with the different color code) <tr bgcolor="#00><td align="left">. I've also tried downgrading to older releases with the same situation. I don't believe I was not having problems with these relases previously. I've also used lynx on the server to load the page and changed to a source view. The html shows truncated there as well. I guess that rules out somthing local at my location.

Wow. I just found the bug in get_color_text(). It's returning a pointer to a buffer in the function, but that buffer isn't declared static. So, there's no guarantee that it won't disappear or get munged before it is used. get_quota_used() suffered from the same problem.


Try this diff and see if it fixes the problem:

===================================================================
RCS file: /cvsroot/qmailadmin/qmailadmin/util.c,v
retrieving revision 1.3
diff -u -r1.3 util.c
--- util.c      8 Dec 2003 17:52:12 -0000       1.3
+++ util.c      7 Jan 2004 15:20:54 -0000
@@ -316,7 +316,7 @@

 char *get_color_text( char *index )
 {
- char tmpbuf[400];
+ static char tmpbuf[400];
  char *tmpstr;

   if (color_table == NULL) return("");
@@ -333,8 +333,7 @@
 }
 /* bk - use maildir++ quotas now
 char *get_quota_used(char *dir) {
-    char *tmpstr;
-    char tmpbuff[MAX_BUFF];
+    static char tmpbuff[40];
     double size;

     size = get_du(dir);
@@ -342,8 +341,7 @@
         size = size / 1048576;
     }
     sprintf(tmpbuff, "%.2lf", size);
-    tmpstr = tmpbuff;
-    return tmpstr;
+    return tmpbuff;
 }
 */
 /* quota_to_bytes: used to convert user entered quota (given in MB)

--
Tom Collins  -  [EMAIL PROTECTED]
QmailAdmin: http://qmailadmin.sf.net/  Vpopmail: http://vpopmail.sf.net/
Info on the Sniffter hand-held Network Tester: http://sniffter.com/



Reply via email to