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

Side by Side Diff: core/include/fxcrt/fx_system.h

Issue 1133323003: Restore checked strlen conversions. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 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
« 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 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium 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 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef _FX_SYSTEM_H_ 7 #ifndef _FX_SYSTEM_H_
8 #define _FX_SYSTEM_H_ 8 #define _FX_SYSTEM_H_
9 #define _FX_WIN32_DESKTOP_ 1 9 #define _FX_WIN32_DESKTOP_ 1
10 #define _FX_LINUX_DESKTOP_ 4 10 #define _FX_LINUX_DESKTOP_ 4
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ 185 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
186 #ifdef _NATIVE_WCHAR_T_DEFINED 186 #ifdef _NATIVE_WCHAR_T_DEFINED
187 #define FXSYS_wfopen(f, m) _wfopen((const wchar_t*)(f), (const wchar_t*)(m)) 187 #define FXSYS_wfopen(f, m) _wfopen((const wchar_t*)(f), (const wchar_t*)(m))
188 #else 188 #else
189 #define FXSYS_wfopen _wfopen 189 #define FXSYS_wfopen _wfopen
190 #endif 190 #endif
191 #else 191 #else
192 FXSYS_FILE* FXSYS_wfopen(FX_LPCWSTR filename, FX_LPCWSTR mode); 192 FXSYS_FILE* FXSYS_wfopen(FX_LPCWSTR filename, FX_LPCWSTR mode);
193 #endif 193 #endif
194 194
195 #ifdef __cplusplus
196 } // extern "C"
197 #include "../../../third_party/base/numerics/safe_conversions.h"
198 #define FXSYS_strlen(ptr) pdfium::base::checked_cast<FX_STRSIZE>(strlen(ptr))
199 #define FXSYS_wcslen(ptr) pdfium::base::checked_cast<FX_STRSIZE>(wcslen(ptr))
200 extern "C" {
201 #else
195 #define FXSYS_strlen(ptr) ((FX_STRSIZE)strlen(ptr)) 202 #define FXSYS_strlen(ptr) ((FX_STRSIZE)strlen(ptr))
196 #define FXSYS_wcslen(ptr) ((FX_STRSIZE)wcslen(ptr)) 203 #define FXSYS_wcslen(ptr) ((FX_STRSIZE)wcslen(ptr))
204 #endif
197 205
198 #define FXSYS_wcscmp wcscmp 206 #define FXSYS_wcscmp wcscmp
199 #define FXSYS_wcschr wcschr 207 #define FXSYS_wcschr wcschr
200 #define FXSYS_wcsstr wcsstr 208 #define FXSYS_wcsstr wcsstr
201 #define FXSYS_wcsncmp wcsncmp 209 #define FXSYS_wcsncmp wcsncmp
202 #define FXSYS_vswprintf vswprintf 210 #define FXSYS_vswprintf vswprintf
203 #define FXSYS_mbstowcs mbstowcs 211 #define FXSYS_mbstowcs mbstowcs
204 #define FXSYS_wcstombs wcstombs 212 #define FXSYS_wcstombs wcstombs
205 #define FXSYS_memcmp memcmp 213 #define FXSYS_memcmp memcmp
206 #define FXSYS_memcpy memcpy 214 #define FXSYS_memcpy memcpy
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 343
336 #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ 344 #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
337 345
338 #if !defined(PRIuS) 346 #if !defined(PRIuS)
339 #define PRIuS "Iu" 347 #define PRIuS "Iu"
340 #endif 348 #endif
341 349
342 #endif 350 #endif
343 351
344 #endif 352 #endif
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