scoring - bugfix for summaryview
authorHoà Viêt Dinh <dinh.viet.hoa@free.fr>
Sun, 6 May 2001 12:47:27 +0000 (12:47 +0000)
committerHoà Viêt Dinh <dinh.viet.hoa@free.fr>
Sun, 6 May 2001 12:47:27 +0000 (12:47 +0000)
ChangeLog.claws
src/summaryview.c
src/utils.c
src/utils.h

index 3c59b6d10c41cdc0e68e264ee04406992f96e917..624e998d4d3adeba35b68394918af3ef4b0b8c6f 100644 (file)
@@ -1,3 +1,11 @@
+2001-05-06 [hoa]
+
+       * src/utils.[ch]
+               added function itos_buf() to enable use of several buffers
+       * src/summaryview.c
+               use of itos_buf() instead of itos() in summary list
+               to fix the broken display of message number.
+
 2001-05-06 [alfons]
 
        * src/gtkstext.c: bug in cursor up navigation fixed,
index 13bc81db132a0fd40470a313fddbd001ae7df2f8..8712c2e9600283cc5cee00ff7a98912a65273c22 100644 (file)
@@ -1536,13 +1536,15 @@ static void summary_set_header(gchar *text[], MsgInfo *msginfo)
 {
        static gchar date_modified[80];
        static gchar *to = NULL;
+       static gchar col_number[11];
+       static gchar col_score[11];
 
        text[S_COL_MARK]   = NULL;
        text[S_COL_UNREAD] = NULL;
        text[S_COL_MIME] = NULL;
-       text[S_COL_NUMBER] = itos(msginfo->msgnum);
+       text[S_COL_NUMBER] = itos_buf(col_number, msginfo->msgnum);
        text[S_COL_SIZE]   = to_human_readable(msginfo->size);
-       text[S_COL_SCORE]  = itos(msginfo->score);
+       text[S_COL_SCORE]  = itos_buf(col_score, msginfo->score);
 
        if (msginfo->date_t) {
                procheader_date_get_localtime(date_modified,
index 5052db1d9dbb82741d5f9f1412b4a3d5bfda96fa..62e95ad71ff656700b054cc25ef0191bc4c4bd00 100644 (file)
@@ -106,13 +106,22 @@ gint to_number(const gchar *nstr)
        return atoi(nstr);
 }
 
-/* convert integer into string */
+/* convert integer into string
+   nstr must be a 11 characters table
+*/
+gchar *itos_buf(gchar nstr[], gint n)
+{
+       g_snprintf(nstr, 11, "%d", n);
+       return nstr;
+}
+
+/* convert integer into string
+   use an internal static buffer */
 gchar *itos(gint n)
 {
        static gchar nstr[11];
 
-       g_snprintf(nstr, 11, "%d", n);
-       return nstr;
+       return itos_buf(nstr, n);
 }
 
 gchar *to_human_readable(off_t size)
index b591b72e1e96a7e601e2eb2dbda3b74c912f32e2..630c190ebfd1044b8b66e3077a75916e30cfcbe8 100644 (file)
@@ -131,6 +131,7 @@ void ptr_array_free_strings (GPtrArray      *array);
 /* number-string conversion */
 gint to_number                 (const gchar *nstr);
 gchar *itos                    (gint         n);
+gchar *itos_buf                 (gchar nstr[], gint n);
 gchar *to_human_readable       (off_t        size);
 
 /* alternative string functions */