NWC: fix format string for loff_t which is longlog on 32 bit
authorWilfried Goesgens <dothebart@citadel.org>
Sat, 9 Feb 2013 13:05:45 +0000 (14:05 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Sat, 9 Feb 2013 13:05:45 +0000 (14:05 +0100)
citadel/configure.ac
citadel/modules/networkclient/serv_networkclient.c
citadel/sysdep_decls.h

index c140e7640f65e467b26b5d217e05331d978f80fa..3a7997869eb19d16e847765e31f3830164749f8c 100644 (file)
@@ -406,6 +406,7 @@ AC_CHECK_SIZEOF(short, 0)
 AC_CHECK_SIZEOF(int, 0)
 AC_CHECK_SIZEOF(long, 0)
 AC_CHECK_SIZEOF(size_t, 0)
+AC_CHECK_SIZEOF(loff_t, 0)
 dnl AC_CHECK_SIZEOF(long long, 0)
 
 dnl Checks for libraries.
index 4c1afa883f6a56a3de089c4f2b2e079a4508b7dc..d92016620bf5f35ef2f9f329710d1a1dc779bcf8 100644 (file)
@@ -378,7 +378,7 @@ eNextState NWC_SendREAD(AsyncNetworker *NW)
                        SetNWCState(IO, eNWCVSFail);
                        return eAbort;
                }
-               StrBufPrintf(NW->IO.SendBuf.Buf, "READ %ld|%ld\n",
+               StrBufPrintf(NW->IO.SendBuf.Buf, "READ "LOFF_T_FMT"|%ld\n",
                             NW->IO.IOB.TotalSentAlready,
                             NW->IO.IOB.TotalSendSize);
 /*
@@ -561,7 +561,7 @@ eNextState NWC_ReadNUOPReply(AsyncNetworker *NW)
 eNextState NWC_SendWRIT(AsyncNetworker *NW)
 {
        AsyncIO *IO = &NW->IO;
-       StrBufPrintf(NW->IO.SendBuf.Buf, "WRIT %ld\n", 
+       StrBufPrintf(NW->IO.SendBuf.Buf, "WRIT "LOFF_T_FMT"\n", 
                     NW->IO.IOB.TotalSendSize - NW->IO.IOB.TotalSentAlready);
        NWC_DBG_SEND();
        return eSendReply;
index d301ffb142b5823a9ae6b689b6fe7c155fe9e7be..23e8b2dd8d10ea4b93fa96368adbf26a6b5c4b97 100644 (file)
 #define SIZE_T_FMT "%ld"
 #endif
 
+#if SIZEOF_LOFF_T == SIZEOF_LONG 
+#define LOFF_T_FMT "%ld"
+#else
+#define LOFF_T_FMT "%lld"
+#endif
+
 void cputbuf(const StrBuf *Buf);
 
 #ifdef __GNUC__