From 579aa5b440a3aefd287a00f4d7fc58d19019c000 Mon Sep 17 00:00:00 2001 From: Simon Giesecke Date: Mon, 23 Dec 2019 12:05:21 +0100 Subject: [PATCH] Problem: non-loop-variables initialized via loop initializer Solution: move initialization to declaration --- src/ws_engine.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ws_engine.cpp b/src/ws_engine.cpp index 61ef778c..dfff1239 100644 --- a/src/ws_engine.cpp +++ b/src/ws_engine.cpp @@ -884,11 +884,11 @@ encode_base64 (const unsigned char *in_, int in_len_, char *out_, int out_len_) static const unsigned char base64enc_tab[65] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - int ii, io; - uint32_t v; - int rem; + int io = 0; + uint32_t v = 0; + int rem = 0; - for (io = 0, ii = 0, v = 0, rem = 0; ii < in_len_; ii++) { + for (int ii = 0; ii < in_len_; ii++) { unsigned char ch; ch = in_[ii]; v = (v << 8) | ch;