summaryrefslogtreecommitdiff
path: root/bkucommon/src/main/java/at/gv/egiz/bku/binding
diff options
context:
space:
mode:
Diffstat (limited to 'bkucommon/src/main/java/at/gv/egiz/bku/binding')
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/XWWWFormUrlInputIterator.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/binding/XWWWFormUrlInputIterator.java b/bkucommon/src/main/java/at/gv/egiz/bku/binding/XWWWFormUrlInputIterator.java
index f052ce05..f60b42b3 100644
--- a/bkucommon/src/main/java/at/gv/egiz/bku/binding/XWWWFormUrlInputIterator.java
+++ b/bkucommon/src/main/java/at/gv/egiz/bku/binding/XWWWFormUrlInputIterator.java
@@ -312,12 +312,18 @@ public class XWWWFormUrlInputIterator implements Iterator<FormParameter> {
} else if (buf[pos] == '+') {
b[off] = ' ';
} else if (buf[pos] == '%') {
- if (++pos == count && (count = in.read(buf)) == -1) {
- throw new IOException("Invalid URL encoding.");
+ if (++pos == count) {
+ if ((count = in.read(buf)) == -1) {
+ throw new IOException("Invalid URL encoding.");
+ }
+ pos = 0;
}
int c1 = Character.digit(buf[pos], 16);
- if (++pos == count && (count = in.read(buf)) == -1) {
- throw new IOException("Invalid URL encoding.");
+ if (++pos == count) {
+ if ((count = in.read(buf)) == -1) {
+ throw new IOException("Invalid URL encoding.");
+ }
+ pos = 0;
}
int c2 = Character.digit(buf[pos], 16);
b[off] = (byte) ((c1 << 4) | c2);