logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

CVS: loki.66h.42h.de: ports: msg#00445

Subject: CVS: loki.66h.42h.de: ports
CVSROOT:        /cvs
Module name:    ports
Changes by:     tg-HWpLtmw5iEWuiImvZfsuaA@xxxxxxxxxxxxxxxx      2004/11/24 
21:04:05 UTC

Added files:
        mailnews/pine/patches: patch-imap_src_osdep_unix_phile_c 
                               patch-pine_adrbklib_c patch-pine_reply_c 

Log message:
compiler warnings similar to the following are the most dangerous:
| adrbklib.c:4920: warning: int format, different type arg (arg 4)
| phile.c:295: warning: int format, different type arg (arg 6)
They almost always point to problems with time_t.

(Of course, if fixing these, you might want to fix the others in
 the file too. Don't if you aren't 100% sure of the fix or got it
 ok'd by me, though. And test on sparc, i386/#7quater and OpenBSD.)

Two possible truncation types:
a) convert to int64_t, output with %lld or %llX
-  sprintf (tmp,"%s, %d %s %d %02d:%02d:%02d %c%02d%02d",
-          days[t->tm_wday],t->tm_mday,months[t->tm_mon],t->tm_year+1900,
+  sprintf (tmp,"%s, %d %s %lld %02d:%02d:%02d %c%02d%02d",
+          days[t->tm_wday],t->tm_mday,months[t->tm_mon],
+          (int64_t)t->tm_year+1900,

b) truncate to int after modulo operation, output as usual
   ATTENTION: the extra braches here are actually required!
-                   DELETED, (tm_now->tm_year)%100, tm_now->tm_mon+1,
+                   DELETED, (int)((tm_now->tm_year)%100), tm_now->tm_mon+1,

Be careful.




<Prev in Thread] Current Thread [Next in Thread>