Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: content/renderer/android/address_detector.cc

Issue 10332192: char16 array should be null-terminated to be assigned to string16 (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "content/renderer/android/address_detector.h" 5 #include "content/renderer/android/address_detector.h"
6 6
7 #include <bitset> 7 #include <bitset>
8 8
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 // Maximum number of digits of a house number, including possible hyphens. 49 // Maximum number of digits of a house number, including possible hyphens.
50 const size_t kMaxHouseDigits = 5; 50 const size_t kMaxHouseDigits = 5;
51 51
52 // Additional characters used as new line delimiters. 52 // Additional characters used as new line delimiters.
53 const char16 kNewlineDelimiters[] = { 53 const char16 kNewlineDelimiters[] = {
54 '\n', 54 '\n',
55 ',', 55 ',',
56 '*', 56 '*',
57 0x2022, // Unicode bullet 57 0x2022, // Unicode bullet
58 0,
58 }; 59 };
59 60
60 char16 SafePreviousChar(const string16::const_iterator& it, 61 char16 SafePreviousChar(const string16::const_iterator& it,
61 const string16::const_iterator& begin) { 62 const string16::const_iterator& begin) {
62 if (it == begin) 63 if (it == begin)
63 return ' '; 64 return ' ';
64 return *(it - 1); 65 return *(it - 1);
65 } 66 }
66 67
67 char16 SafeNextChar(const string16::const_iterator& it, 68 char16 SafeNextChar(const string16::const_iterator& it,
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 location_names[i].string, 828 location_names[i].string,
828 location_names[i].allow_plural)) { 829 location_names[i].allow_plural)) {
829 return true; 830 return true;
830 } 831 }
831 } 832 }
832 833
833 return false; 834 return false;
834 } 835 }
835 836
836 } // namespace content 837 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698