mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Maybe avoid a string index out of bounds exception here?
git-svn-id: https://zxing.googlecode.com/svn/trunk@2265 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
a1601d1bb8
commit
18c3b38a9a
|
@ -140,8 +140,8 @@ public final class VCardResultParser extends ResultParser {
|
||||||
rawText.charAt(i+1) == '\t')) {
|
rawText.charAt(i+1) == '\t')) {
|
||||||
i += 2; // Skip \n and continutation whitespace
|
i += 2; // Skip \n and continutation whitespace
|
||||||
} else if (quotedPrintable && // If preceded by = in quoted printable
|
} else if (quotedPrintable && // If preceded by = in quoted printable
|
||||||
(rawText.charAt(i-1) == '=' || // this is a continuation
|
((i >= 1 && rawText.charAt(i-1) == '=') || // this is a continuation
|
||||||
rawText.charAt(i-2) == '=')) {
|
(i >= 2 && rawText.charAt(i-2) == '='))) {
|
||||||
i++; // Skip \n
|
i++; // Skip \n
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
|
@ -156,7 +156,7 @@ public final class VCardResultParser extends ResultParser {
|
||||||
if (matches == null) {
|
if (matches == null) {
|
||||||
matches = new ArrayList<List<String>>(1); // lazy init
|
matches = new ArrayList<List<String>>(1); // lazy init
|
||||||
}
|
}
|
||||||
if (rawText.charAt(i-1) == '\r') {
|
if (i >= 1 && rawText.charAt(i-1) == '\r') {
|
||||||
i--; // Back up over \r, which really should be there
|
i--; // Back up over \r, which really should be there
|
||||||
}
|
}
|
||||||
String element = rawText.substring(matchStart, i);
|
String element = rawText.substring(matchStart, i);
|
||||||
|
|
Loading…
Reference in a new issue