| OLD | NEW |
| 1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ | 1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
| 2 /* This Source Code Form is subject to the terms of the Mozilla Public | 2 /* This Source Code Form is subject to the terms of the Mozilla Public |
| 3 * License, v. 2.0. If a copy of the MPL was not distributed with this | 3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 5 | 5 |
| 6 /* | 6 /* |
| 7 ** Portable safe sprintf code. | 7 ** Portable safe sprintf code. |
| 8 ** | 8 ** |
| 9 ** Author: Kipp E.B. Hickman | 9 ** Author: Kipp E.B. Hickman |
| 10 */ | 10 */ |
| 11 #include <stdarg.h> | 11 #include <stdarg.h> |
| 12 #include <stddef.h> | 12 #include <stddef.h> |
| 13 #include <stdio.h> | 13 #include <stdio.h> |
| 14 #include <string.h> | 14 #include <string.h> |
| 15 #include "primpl.h" | 15 #include "primpl.h" |
| 16 #include "prprf.h" | 16 #include "prprf.h" |
| 17 #include "prlong.h" | 17 #include "prlong.h" |
| 18 #include "prlog.h" | 18 #include "prlog.h" |
| 19 #include "prmem.h" | 19 #include "prmem.h" |
| 20 | 20 |
| 21 #ifdef _MSC_VER | 21 #if defined(_MSC_VER) && _MSC_VER < 1900 |
| 22 #define snprintf _snprintf | 22 #define snprintf _snprintf |
| 23 #endif | 23 #endif |
| 24 | 24 |
| 25 /* | 25 /* |
| 26 ** WARNING: This code may *NOT* call PR_LOG (because PR_LOG calls it) | 26 ** WARNING: This code may *NOT* call PR_LOG (because PR_LOG calls it) |
| 27 */ | 27 */ |
| 28 | 28 |
| 29 /* | 29 /* |
| 30 ** XXX This needs to be internationalized! | 30 ** XXX This needs to be internationalized! |
| 31 */ | 31 */ |
| (...skipping 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1239 rv = dosprintf(&ss, fmt, ap); | 1239 rv = dosprintf(&ss, fmt, ap); |
| 1240 if (rv < 0) { | 1240 if (rv < 0) { |
| 1241 if (ss.base) { | 1241 if (ss.base) { |
| 1242 PR_DELETE(ss.base); | 1242 PR_DELETE(ss.base); |
| 1243 } | 1243 } |
| 1244 return 0; | 1244 return 0; |
| 1245 } | 1245 } |
| 1246 return ss.base; | 1246 return ss.base; |
| 1247 } | 1247 } |
| 1248 | 1248 |
| OLD | NEW |