summaryrefslogtreecommitdiff
path: root/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc')
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc
index af0a5a6539..0537043cd4 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc
@@ -225,8 +225,13 @@ size_t OnSystemRequestNotification::ParsePTString(
size_t result_length = length;
result.reserve(length * 2);
for (size_t i = 0; i < length; ++i) {
- if (pt_string[i] == '\"' || pt_string[i] == '\\') {
+ if (pt_string[i] == '\"') {
result += '\\';
+ } else if (pt_string[i] == '\\') {
+ result += '\\';
+ --result_length; // contentLength is adjusted for the additional escape
+ // character added before special characters (like the
+ // newline string)
} else if (pt_string[i] == '\n') {
--result_length; // contentLength is adjusted when this character is
// not copied to result.