summaryrefslogtreecommitdiff
path: root/plugins/CryptoPP/src/utf8.cpp
diff options
context:
space:
mode:
authorGoraf <22941576+Goraf@users.noreply.github.com>2017-11-13 15:03:31 +0100
committerGoraf <22941576+Goraf@users.noreply.github.com>2017-11-13 15:07:33 +0100
commita7c24ca48995cf2bf436156302f96b91bf135409 (patch)
tree953835509ff1b778833e78fd7b74b05e05e77c84 /plugins/CryptoPP/src/utf8.cpp
parent591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff)
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/CryptoPP/src/utf8.cpp')
-rw-r--r--plugins/CryptoPP/src/utf8.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/plugins/CryptoPP/src/utf8.cpp b/plugins/CryptoPP/src/utf8.cpp
index 77c13fa3bc..83d4e4a97a 100644
--- a/plugins/CryptoPP/src/utf8.cpp
+++ b/plugins/CryptoPP/src/utf8.cpp
@@ -1,15 +1,15 @@
#include "commonheaders.h"
-LPSTR szOut = NULL;
-LPWSTR wszOut = NULL;
+LPSTR szOut = nullptr;
+LPWSTR wszOut = nullptr;
LPSTR __cdecl utf8encode(LPCWSTR str)
{
LPWSTR wszTemp, w;
int len, i;
- if (str == NULL)
- return NULL;
+ if (str == nullptr)
+ return nullptr;
wszTemp = (LPWSTR)str;
@@ -21,8 +21,8 @@ LPSTR __cdecl utf8encode(LPCWSTR str)
}
SAFE_FREE(szOut);
- if ((szOut = (LPSTR)malloc(len + 1)) == NULL)
- return NULL;
+ if ((szOut = (LPSTR)malloc(len + 1)) == nullptr)
+ return nullptr;
i = 0;
for (w = wszTemp; *w; w++) {
@@ -49,13 +49,13 @@ LPWSTR __cdecl utf8decode(LPCSTR str)
LPSTR p;
// LPWSTR wszOut;
- if (str == NULL) return NULL;
+ if (str == nullptr) return nullptr;
size_t len = strlen(str) + 1;
SAFE_FREE(wszOut);
- if ((wszOut = (LPWSTR)malloc(len*sizeof(WCHAR))) == NULL)
- return NULL;
+ if ((wszOut = (LPWSTR)malloc(len*sizeof(WCHAR))) == nullptr)
+ return nullptr;
p = (LPSTR)str;
i = 0;
while (*p) {