summaryrefslogtreecommitdiff
path: root/plugins/UserInfoEx/src/mir_string.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/UserInfoEx/src/mir_string.cpp')
-rw-r--r--plugins/UserInfoEx/src/mir_string.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/UserInfoEx/src/mir_string.cpp b/plugins/UserInfoEx/src/mir_string.cpp
index a454bbdc9d..2f2dd7a62a 100644
--- a/plugins/UserInfoEx/src/mir_string.cpp
+++ b/plugins/UserInfoEx/src/mir_string.cpp
@@ -54,8 +54,8 @@ wchar_t* mir_wcsncat_c(wchar_t *pwszDest, const wchar_t wcSrc)
char* mir_strnerase(char *pszDest, size_t sizeFrom, size_t sizeTo)
{
char *pszReturn = NULL;
- size_t sizeNew, sizeLen = mir_strlen(pszDest);
- if (sizeFrom >= 0 && sizeFrom < sizeLen && sizeTo >= 0 && sizeTo <= sizeLen && sizeFrom < sizeTo) {
+ size_t sizeNew = 0, sizeLen = mir_strlen(pszDest);
+ if (sizeFrom < sizeLen && sizeTo <= sizeLen && sizeFrom < sizeTo) {
sizeNew = sizeLen - (sizeTo - sizeFrom);
size_t sizeCopy = sizeNew - sizeFrom;
pszReturn = (char *)mir_alloc(sizeNew + 1);