[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE_3_3_BRANCH: kdepim/kmail [POSSIBLY UNSAFE]
From: Marc Mutz <Marc.Mutz () uni-bielefeld ! de>
Date: 2004-10-13 11:11:35
Message-ID: 20041013111135.7606B16CD5 () office ! kde ! org
[Download RAW message or body]
CVS commit by mutz:
- config.h must be first
- rename IDS_HEADER, IDS_VERSION to IDS_SEARCH_* to avoid confusion with IDS_* from kmmsgdict.cpp
M +11 -8 kmfoldersearch.cpp 1.57.2.1 [POSSIBLY UNSAFE: printf,scanf]
--- kdepim/kmail/kmfoldersearch.cpp #1.57:1.57.2.1
@@ -4,4 +4,6 @@
//Factor byteswap stuff into one header file
+#include <config.h>
+
#include "kmfoldersearch.h"
#include "kmfolderimap.h"
@@ -27,5 +29,4 @@
#include <sys/file.h>
#include <utime.h>
-#include <config.h>
#ifdef HAVE_BYTESWAP_H
@@ -37,4 +38,5 @@
/* Swap bytes in 32 bit value. */
+#ifndef kmail_swap_32
#ifdef bswap_32
#define kmail_swap_32(x) bswap_32(x)
@@ -44,10 +46,11 @@
(((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
#endif
+#endif // kmail_swap_32
// Current version of the .index.search files
-#define IDS_VERSION 1000
+#define IDS_SEARCH_VERSION 1000
// The asterisk at the end is important
-#define IDS_HEADER "# KMail-Search-IDs V%d\n*"
-#define IDS_HEADER_LEN 30
+#define IDS_SEARCH_HEADER "# KMail-Search-IDs V%d\n*"
+#define IDS_SEARCH_HEADER_LEN 30
@@ -786,5 +789,5 @@ int KMFolderSearch::writeIndex( bool )
return -1;
}
- fprintf(tmpIndexStream, IDS_HEADER, IDS_VERSION);
+ fprintf(tmpIndexStream, IDS_SEARCH_HEADER, IDS_SEARCH_VERSION);
Q_UINT32 byteOrder = 0x12345678;
fwrite(&byteOrder, sizeof(byteOrder), 1, tmpIndexStream);
@@ -838,6 +841,6 @@ bool KMFolderSearch::readIndex()
int version = 0;
- fscanf(mIdsStream, IDS_HEADER, &version);
- if (version != IDS_VERSION) {
+ fscanf(mIdsStream, IDS_SEARCH_HEADER, &version);
+ if (version != IDS_SEARCH_VERSION) {
fclose(mIdsStream);
mIdsStream = 0;
@@ -956,5 +959,5 @@ void KMFolderSearch::fillDictFromIndex(K
void KMFolderSearch::truncateIndex()
{
- truncate(QFile::encodeName(indexLocation()), IDS_HEADER_LEN);
+ truncate(QFile::encodeName(indexLocation()), IDS_SEARCH_HEADER_LEN);
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic