summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2012-04-30 13:15:15 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-04 12:55:39 +0200
commit5c2a055230e8c3a2bcd0f7f6f601d6c618774a8b (patch)
tree9a1c02786a940cd3bcd6b0135a5733e3f3d64e94
parentf7b1262c7f34e9c685f30dbf7a31ff62e7736795 (diff)
Fix compiler warning
qurlrecode.cpp:481:24: warning: ‘action’ may be used uninitialized in this function [-Wmaybe-uninitialized] Change-Id: I638b65218d1875667e2c60a5720ecda87202b82f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/corelib/io/qurlrecode.cpp5
1 files 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