From: Alan T. DeKok Date: Sun, 29 Apr 2012 10:44:24 +0000 (+0200) Subject: Use the correct type for statistics counters X-Git-Tag: release_3_0_0_beta0~219 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09f7cb5cdbc47816111e1b9cf8e681c98d75dc05;p=thirdparty%2Ffreeradius-server.git Use the correct type for statistics counters --- diff --git a/src/main/stats.c b/src/main/stats.c index b5b67b801c0..255850f4b69 100644 --- a/src/main/stats.c +++ b/src/main/stats.c @@ -431,6 +431,7 @@ static void request_stats_addvp(REQUEST *request, fr_stats2vp *table, fr_stats_t *stats) { int i; + fr_uint_t counter; VALUE_PAIR *vp; for (i = 0; table[i].attribute != 0; i++) { @@ -439,7 +440,8 @@ static void request_stats_addvp(REQUEST *request, PW_TYPE_INTEGER); if (!vp) continue; - vp->vp_integer = *(int *)(((char *) stats) + table[i].offset); + counter = *(fr_uint_t *) (((uint8_t *) stats) + table[i].offset); + vp->vp_integer = counter; } }