From 5c2a055230e8c3a2bcd0f7f6f601d6c618774a8b Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 30 Apr 2012 13:15:15 +0200 Subject: Fix compiler warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qurlrecode.cpp:481:24: warning: ‘action’ may be used uninitialized in this function [-Wmaybe-uninitialized] Change-Id: I638b65218d1875667e2c60a5720ecda87202b82f Reviewed-by: Thiago Macieira --- src/corelib/io/qurlrecode.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/corelib/io/qurlrecode.cpp b/src/corelib/io/qurlrecode.cpp index b586bd7a1e..de9c5aa7db 100644 --- a/src/corelib/io/qurlrecode.cpp +++ b/src/corelib/io/qurlrecode.cpp @@ -483,6 +483,8 @@ static int recode(QString &result, const ushort *begin, const ushort *end, QUrl: // try a run where no change is necessary for ( ; input != end; ++input) { c = *input; + if (c < 0x20U) + action = EncodeCharacter; if (c < 0x20U || c >= 0x80U) // also: (c - 0x20 < 0x60U) goto non_trivial; action = EncodingAction(actionTable[c - ' ']); @@ -534,9 +536,6 @@ non_trivial: } } - if (decoded < 0x20) - action = EncodeCharacter; - // there are six possibilities: // current \ action | DecodeCharacter | LeaveCharacter | EncodeCharacter // decoded | 1:leave | 2:leave | 3:encode -- cgit v1.2.3