diff --git a/core/src/com/google/zxing/client/result/EmailDoCoMoResultParser.java b/core/src/com/google/zxing/client/result/EmailDoCoMoResultParser.java index 6e12df042..312d65298 100644 --- a/core/src/com/google/zxing/client/result/EmailDoCoMoResultParser.java +++ b/core/src/com/google/zxing/client/result/EmailDoCoMoResultParser.java @@ -55,8 +55,20 @@ final class EmailDoCoMoResultParser extends AbstractDoCoMoResultParser { if (email == null) { return false; } - int atIndex = email.indexOf('@'); - return atIndex >= 0 && email.indexOf('.') > atIndex && email.indexOf(' ') < 0; + boolean atFound = false; + for (int i = 0; i < email.length(); i++) { + char c = email.charAt(i); + if (c == '@') { + atFound = true; + } else if (c == '.') { + if (!atFound) { + return false; + } + } else if (c == ' ' || c == '\n') { + return false; + } + } + return true; } } \ No newline at end of file