> You didn't provide a dmesg so I don't know what architecture you're on, but
> that code will certainly fail on i386 and other ILP32 archs because it
> assumes time_t is the same size as long.  As of OpenBSD 5.5 it's now a long
> long, which is larger on ILP32 archs.  That and other printing/scanning
> code should be using %lld and casting time_t values to (long long)
> explicitly, ala:
> 
>        snprintf(buf, sizeof(buf), "%u " MODSEQ_FMT " %lld (%u) %lld %s",
>                record->uid, record->modseq, (long
> long)record->last_updated,
>                flagcrc, (long long)record->internaldate,
>                message_guid_encode(&record->guid));
> 

Yes, I’m on i386 arch.

---
OpenBSD 5.5-stable (SATURN) #0: Fri Jun 13 14:39:46 JST 2014
    taka...@saturn.takaaki.atnifty.com:/usr/obj/sys/arch/i386/compile/SATURN
cpu0: Intel(R) Core(TM)2 Quad CPU Q9400 @ 2.66GHz ("GenuineIntel" 686-class) 
2.67 GHz
---

I understand that.

I delete my patch patch-lib_util_h,
and add new patch-imap_maibox_c.

---
*** imap/mailbox.c.orig Sun Dec  2 04:57:54 2012
--- imap/mailbox.c      Mon Jun 16 17:24:01 2014
***************
*** 1960,1969 ****
        flagcrc ^= crc32_cstring(buf);
      }
  
!     snprintf(buf, 4096, "%u " MODSEQ_FMT " %lu (%u) %lu %s",
!           record->uid, record->modseq, record->last_updated,
            flagcrc,
!           record->internaldate,
            message_guid_encode(&record->guid));
  
      return crc32_cstring(buf);
--- 1960,1969 ----
        flagcrc ^= crc32_cstring(buf);
      }
  
!     snprintf(buf, 4096, "%u " MODSEQ_FMT " %lld (%u) %lld %s",
!           record->uid, record->modseq, (long long)record->last_updated,
            flagcrc,
!           (long long)record->internaldate,
            message_guid_encode(&record->guid));
  
      return crc32_cstring(buf);
---

rebuilt and worked well, too.

But there are many other place that receive time_t value by “%lu” probably ….

Thank you very much.

---
Takaaki Kobayashi
    takaaki.kobaya...@nifty.com

Reply via email to