aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2016-02-12 05:54:20 +0000
committerJoão Valverde <j@v6e.pt>2016-02-20 14:27:42 +0000
commit071dfd761dd2d63cff2b55c505b7d1d95d06e22c (patch)
treed7c73d6fe79c8fab41cd3d4442aed4b081b1094b /wsutil
parent1b3ae81e9ef337e55be170d8afbf2361d0e4d7fc (diff)
sober: fix cannot optimize loops warning [-Wunsafe-loop-optimizations]
Change-Id: I180b1ef53f9adcf4625d0cf9ee35066aa21ee59b Reviewed-on: https://code.wireshark.org/review/13934 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'wsutil')
-rw-r--r--wsutil/sober128.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/wsutil/sober128.c b/wsutil/sober128.c
index 5534cef3e2..a909cc9026 100644
--- a/wsutil/sober128.c
+++ b/wsutil/sober128.c
@@ -788,8 +788,8 @@ int sober128_add_entropy(const unsigned char *buf, unsigned long len, sober128_p
/* len must be multiple of 4 bytes */
/* assert ((len & 3) == 0); */
- for (i = 0; i < len; i += 4) {
- k = BYTE2WORD(&buf[i]);
+ for (i = 0; i < len/4; i++) {
+ k = BYTE2WORD(&buf[i*4]);
ADDKEY(k);
cycle(c->R);
XORNL(nltap(c));
@@ -813,8 +813,8 @@ int sober128_add_entropy(const unsigned char *buf, unsigned long len, sober128_p
/* len must be multiple of 4 bytes */
/* assert ((len & 3) == 0); */
- for (i = 0; i < len; i += 4) {
- k = BYTE2WORD(&buf[i]);
+ for (i = 0; i < len/4; i++) {
+ k = BYTE2WORD(&buf[i*4]);
ADDKEY(k);
cycle(c->R);
XORNL(nltap(c));