| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "remoting/host/setup/pin_validator.h" | 5 #include "remoting/host/setup/pin_validator.h" |
| 6 | 6 |
| 7 namespace remoting { | 7 namespace remoting { |
| 8 | 8 |
| 9 bool IsPinValid(const std::string& pin) { | 9 bool IsPinValid(const std::string& pin) { |
| 10 if (pin.length() < 6) { | 10 if (pin.length() < 6) |
| 11 return false; | 11 return false; |
| 12 } | |
| 13 for (size_t i = 0; i < pin.length(); i++) { | 12 for (size_t i = 0; i < pin.length(); i++) { |
| 14 char c = pin[i]; | 13 char c = pin[i]; |
| 15 if (c < '0' || c > '9') { | 14 if (c < '0' || c > '9') |
| 16 return false; | 15 return false; |
| 17 } | |
| 18 } | 16 } |
| 19 return true; | 17 return true; |
| 20 } | 18 } |
| 21 | 19 |
| 22 } // namespace remoting | 20 } // namespace remoting |
| OLD | NEW |