summaryrefslogtreecommitdiffstats
path: root/cfsysline.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-31 12:54:10 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-31 12:54:10 +0000
commit41fb70130f992f9d9ea848fa99778def76d95d05 (patch)
tree1f40ace013cf31fefe7f298f6f6d0d6529b11f64 /cfsysline.c
parent260e2be5d69d9fe7ec3fd533430b9bd6effd55c0 (diff)
downloadrsyslog-41fb70130f992f9d9ea848fa99778def76d95d05.tar.gz
rsyslog-41fb70130f992f9d9ea848fa99778def76d95d05.tar.xz
rsyslog-41fb70130f992f9d9ea848fa99778def76d95d05.zip
bugfix: having fun with 32/64 bit portability - after 15 years, I finally
was trapped again ;) -- now fixed, sizes > 2GB supported on 32bit platforms
Diffstat (limited to 'cfsysline.c')
-rw-r--r--cfsysline.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/cfsysline.c b/cfsysline.c
index d307569b..0cc6c134 100644
--- a/cfsysline.c
+++ b/cfsysline.c
@@ -101,11 +101,11 @@ finalize_it:
* for INTERNAL USE by other parse functions!
* rgerhards, 2008-01-08
*/
-static rsRetVal parseIntVal(uchar **pp, size_t *pVal)
+static rsRetVal parseIntVal(uchar **pp, int64 *pVal)
{
DEFiRet;
uchar *p;
- size_t i;
+ int64 i;
int bWasNegative;
assert(pp != NULL);
@@ -153,7 +153,7 @@ static rsRetVal doGetInt(uchar **pp, rsRetVal (*pSetHdlr)(void*, uid_t), void *p
{
uchar *p;
DEFiRet;
- size_t i;
+ int64 i;
assert(pp != NULL);
assert(*pp != NULL);
@@ -179,13 +179,13 @@ finalize_it:
/* Parse a size from the configuration line. This is basically an integer
* syntax, but modifiers may be added after the integer (e.g. 1k to mean
* 1024). The size must immediately follow the number. Note that the
- * param value must be size_t!
+ * param value must be int64!
* rgerhards, 2008-01-09
*/
static rsRetVal doGetSize(uchar **pp, rsRetVal (*pSetHdlr)(void*, uid_t), void *pVal)
{
DEFiRet;
- size_t i;
+ int64 i;
assert(pp != NULL);
assert(*pp != NULL);
@@ -201,9 +201,9 @@ static rsRetVal doGetSize(uchar **pp, rsRetVal (*pSetHdlr)(void*, uid_t), void *
case 'k': i *= 1024; ++(*pp); break;
case 'm': i *= 1024 * 1024; ++(*pp); break;
case 'g': i *= 1024 * 1024 * 1024; ++(*pp); break;
- case 't': i *= (size_t) 1024 * 1024 * 1024 * 1024; ++(*pp); break; /* tera */
- case 'p': i *= (size_t) 1024 * 1024 * 1024 * 1024 * 1024; ++(*pp); break; /* peta */
- case 'e': i *= (size_t) 1024 * 1024 * 1024 * 1024 * 1024 * 1024; ++(*pp); break; /* exa */
+ case 't': i *= (int64) 1024 * 1024 * 1024 * 1024; ++(*pp); break; /* tera */
+ case 'p': i *= (int64) 1024 * 1024 * 1024 * 1024 * 1024; ++(*pp); break; /* peta */
+ case 'e': i *= (int64) 1024 * 1024 * 1024 * 1024 * 1024 * 1024; ++(*pp); break; /* exa */
/* and now the "new" 1000-based definitions */
case 'K': i *= 1000; ++(*pp); break;
case 'M': i *= 10000; ++(*pp); break;
@@ -216,7 +216,7 @@ static rsRetVal doGetSize(uchar **pp, rsRetVal (*pSetHdlr)(void*, uid_t), void *
/* done */
if(pSetHdlr == NULL) {
/* we should set value directly to var */
- *((size_t*)pVal) = i;
+ *((int64*)pVal) = i;
} else {
/* we set value via a set function */
CHKiRet(pSetHdlr(pVal, i));