| OLD | NEW |
| 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 #include "../../include/fxcrt/fx_basic.h" | 7 #include "../../include/fxcrt/fx_basic.h" |
| 8 #include "../../../third_party/numerics/safe_math.h" | 8 #include "../../../third_party/numerics/safe_math.h" |
| 9 | 9 |
| 10 static CFX_StringDataW* FX_AllocStringW(int nLen) | 10 static CFX_StringDataW* FX_AllocStringW(int nLen) |
| (...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 else { | 822 else { |
| 823 break; | 823 break; |
| 824 } | 824 } |
| 825 } | 825 } |
| 826 if (nWidth == 0) { | 826 if (nWidth == 0) { |
| 827 nWidth = FXSYS_wtoi(lpsz); | 827 nWidth = FXSYS_wtoi(lpsz); |
| 828 for (; *lpsz != 0 && (*lpsz) <= '9' && (*lpsz) >= '0'; lpsz ++) | 828 for (; *lpsz != 0 && (*lpsz) <= '9' && (*lpsz) >= '0'; lpsz ++) |
| 829 ; | 829 ; |
| 830 } | 830 } |
| 831 if (nWidth < 0 || nWidth > 128 * 1024) { | 831 if (nWidth < 0 || nWidth > 128 * 1024) { |
| 832 lpszFormat = (FX_LPCWSTR)L"Bad width"; | 832 lpszFormat = L"Bad width"; |
| 833 nMaxLen = 10; | 833 nMaxLen = 10; |
| 834 break; | 834 break; |
| 835 } | 835 } |
| 836 int nPrecision = 0; | 836 int nPrecision = 0; |
| 837 if (*lpsz == '.') { | 837 if (*lpsz == '.') { |
| 838 lpsz ++; | 838 lpsz ++; |
| 839 if (*lpsz == '*') { | 839 if (*lpsz == '*') { |
| 840 nPrecision = va_arg(argList, int); | 840 nPrecision = va_arg(argList, int); |
| 841 lpsz ++; | 841 lpsz ++; |
| 842 } else { | 842 } else { |
| 843 nPrecision = FXSYS_wtoi(lpsz); | 843 nPrecision = FXSYS_wtoi(lpsz); |
| 844 for (; *lpsz != 0 && (*lpsz) >= '0' && (*lpsz) <= '9'; lpsz ++) | 844 for (; *lpsz != 0 && (*lpsz) >= '0' && (*lpsz) <= '9'; lpsz ++) |
| 845 ; | 845 ; |
| 846 } | 846 } |
| 847 } | 847 } |
| 848 if (nPrecision < 0 || nPrecision > 128 * 1024) { | 848 if (nPrecision < 0 || nPrecision > 128 * 1024) { |
| 849 lpszFormat = (FX_LPCWSTR)L"Bad precision"; | 849 lpszFormat = L"Bad precision"; |
| 850 nMaxLen = 14; | 850 nMaxLen = 14; |
| 851 break; | 851 break; |
| 852 } | 852 } |
| 853 int nModifier = 0; | 853 int nModifier = 0; |
| 854 if (*lpsz == L'I' && *(lpsz + 1) == L'6' && *(lpsz + 2) == L'4') { | 854 if (*lpsz == L'I' && *(lpsz + 1) == L'6' && *(lpsz + 2) == L'4') { |
| 855 lpsz += 3; | 855 lpsz += 3; |
| 856 nModifier = FORCE_INT64; | 856 nModifier = FORCE_INT64; |
| 857 } else { | 857 } else { |
| 858 switch (*lpsz) { | 858 switch (*lpsz) { |
| 859 case 'h': | 859 case 'h': |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1120 return (CFX_CharMap*)&g_DefaultJISMapper; | 1120 return (CFX_CharMap*)&g_DefaultJISMapper; |
| 1121 case 936: | 1121 case 936: |
| 1122 return (CFX_CharMap*)&g_DefaultGBKMapper; | 1122 return (CFX_CharMap*)&g_DefaultGBKMapper; |
| 1123 case 949: | 1123 case 949: |
| 1124 return (CFX_CharMap*)&g_DefaultUHCMapper; | 1124 return (CFX_CharMap*)&g_DefaultUHCMapper; |
| 1125 case 950: | 1125 case 950: |
| 1126 return (CFX_CharMap*)&g_DefaultBig5Mapper; | 1126 return (CFX_CharMap*)&g_DefaultBig5Mapper; |
| 1127 } | 1127 } |
| 1128 return NULL; | 1128 return NULL; |
| 1129 } | 1129 } |
| OLD | NEW |