From ebe8a6f97999645de9f80fe2a400f3f285e04002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Fri, 28 Nov 2014 12:31:58 +0000 Subject: Facebook: Fix utils::text::replace_all method to not result in infinite loop for some inputs This fixes problem with not showing notifications at all when "show notifications in special chatrooms" is enabled and notification with "%" inside is showed (and same problem for multi user chat messages) git-svn-id: http://svn.miranda-ng.org/main/trunk@11128 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/utils.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'protocols') diff --git a/protocols/FacebookRM/src/utils.cpp b/protocols/FacebookRM/src/utils.cpp index 39ab01e2a0..38bde17e73 100644 --- a/protocols/FacebookRM/src/utils.cpp +++ b/protocols/FacebookRM/src/utils.cpp @@ -3,7 +3,7 @@ Facebook plugin for Miranda Instant Messenger _____________________________________________ -Copyright © 2009-11 Michal Zelinka, 2011-13 Robert Pösel +Copyright � 2009-11 Michal Zelinka, 2011-13 Robert P�sel This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -58,7 +58,7 @@ DWORD utils::time::fix_timestamp(unsigned __int64 mili_timestamp) { // If it is really mili_timestamp if (mili_timestamp > 100000000000) { - return (DWORD) (mili_timestamp / 1000); + mili_timestamp /= 1000; } return (DWORD) mili_timestamp; } @@ -113,7 +113,7 @@ void utils::text::replace_all(std::string* data, const std::string &from, const while ((position = data->find(from, position)) != std::string::npos) { data->replace(position, from.size(), to); - position++; + position += to.size(); } } -- cgit v1.2.3