aboutsummaryrefslogtreecommitdiff
path: root/src/common/string_conversion.cc
Commit message (Collapse)AuthorAgeFilesLines
* fix pointer style to match the style guideMike Frysinger2020-07-151-29/+29
| | | | | | | | | | We do this in a lot of places, but we're inconsistent. Normalize the code to the Google C++ style guide. Change-Id: Ic2aceab661ce8f6b993dda21b1cdf5d2198dcbbf Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2262932 Reviewed-by: Sterling Augustine <saugustine@google.com> Reviewed-by: Mark Mentovai <mark@chromium.org>
* string_conversion: fix pointer mathMike Frysinger2019-08-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Since target_ptr is of type uint16_t* already, we don't need to scale the byte count as the language does that for us. If it were void*, we would need this code, but it's not. In practice it's probably not a big deal due to how we preallocated memory: when converting UTF8->UTF16, we'd reserve the same number of code units, and UTF8 takes more code units per codepoint than UTF16, so the UTF16 vector is always oversized. When converting UTF32->UTF16, we also reserve the same number of code units, but since one UTF32 code unit could require two UTF16 code units (for U+10000 codepoints and higher), we would probably corrupt memory in the process. The APIs in this module don't seem to take into account that range in general, so for now I'm only fixing the memory corruption. Bug: google-breakpad:768 Change-Id: Ibfaea4e866733ff8d99b505e72c500bd40d11a74 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1732888 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Fix pointer arithmetic in UTF8ToUTF16CharHans Wennborg2016-10-271-3/+3
| | | | | | | | | | Found by PVS-Studio! BUG=chromium:660198 Change-Id: I2605de2b1499f85c6e01d19e87e9eeb6af8486f3 Reviewed-on: https://chromium-review.googlesource.com/404552 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Switch to scoped_array instead of inappropriate scoped_ptr.jessicag.feedback2013-10-281-1/+1
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1225 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Treat warnings as error and fix most level 4 warnings in the breakpad ↵ivan.penkov@gmail.com2013-06-041-1/+1
| | | | | | | | | | | windows client projects. Some of the lint errors in the files touched by this change were also fixed. BUG=533 Review URL: https://breakpad.appspot.com/601002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1189 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Use stdint types everywhereted.mielczarek@gmail.com2013-03-061-18/+18
| | | | | | R=mark at https://breakpad.appspot.com/535002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1121 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Move scoped_ptr.h to commonted.mielczarek@gmail.com2013-01-171-1/+1
| | | | | | R=mark at https://breakpad.appspot.com/509002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1096 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix type in string_conversion.cc introduced in r1046ted.mielczarek@gmail.com2012-09-261-1/+1
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1049 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Turn on more warnings in ios / mac projects.qsr@chromium.org2012-09-211-1/+1
| | | | | | | | | | | | | | | Make casts explicit. This makes casts that loose precision explicit, from here on we will get warnings. The changes in this commit are made without evaluating each cast, asuming the original casts were intentional. Patch by: jakerr@google.com Review: https://breakpad.appspot.com/453002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1046 4c0a9323-5329-0410-9bdc-e9ce6186880e
* This change allows compiling the google-breakpad code using a global ↵ivan.penkov@gmail.com2012-06-281-3/+4
| | | | | | ::string class instead of std::string. For more details take a look at common/using_std_string.h git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@974 4c0a9323-5329-0410-9bdc-e9ce6186880e
* vectors are cleared with "clear()", not with "empty()thestig@chromium.org2012-04-111-2/+2
| | | | | | | | | | A=thakis@chromium.org R=thestig@chromium.org Original code review: https://breakpad.appspot.com/377003/ Review URL: https://breakpad.appspot.com/380001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@949 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Clean up build for 64 bit.dmaclach2010-07-191-4/+3
| | | | | | | | | | | Fix up some broken mac projects. Consolidate project settings in xcconfig files. http://breakpad.appspot.com/130001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@627 4c0a9323-5329-0410-9bdc-e9ce6186880e
* issue 238 - missing includes compiling with gcc 4.3. patch by taras glek, r=meted.mielczarek2008-02-241-0/+1
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@240 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix bug of issue 135, now can dump symbols for dynamic libraries.luly812007-03-271-2/+2
| | | | | | | | Also some minor fixes to make it compile with more strict compiling options. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@133 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Rename Airbag to Breakpad.mmentovai2007-02-141-2/+2
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@122 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix UTF32ToUTF16Char() conversion. Fixes issue #99. Reviewed by bryner.waylonis2006-12-201-2/+2
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@97 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Change function declarations to match those of the header file. Amazingly, ↵waylonis2006-12-151-12/+12
| | | | | | gcc did not complain. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@89 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Add unicode.org UTF-8/16/32 conversion code.waylonis2006-12-151-0/+154
Add wrapper functions to make things more convenient. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@88 4c0a9323-5329-0410-9bdc-e9ce6186880e