summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2015-04-24 16:18:12 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2015-04-24 16:18:12 +0200
commit7c082e13fb6399b9c86a8d9a35739a6340fdc4e6 (patch)
treefb89f9b4f15ae0f95f3d1f5fbd609f7b3ac54036
parent4dfb94aca370d0bd270e1213480e733c1273c7f6 (diff)
webengine cleanup (nw)
-rw-r--r--src/emu/webengine.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/emu/webengine.c b/src/emu/webengine.c
index 6c04722a5c1..ad6d1928a7e 100644
--- a/src/emu/webengine.c
+++ b/src/emu/webengine.c
@@ -69,7 +69,7 @@ int web_engine::json_game_handler(struct mg_connection *conn)
data["ispaused"] = m_machine->paused();
Json::FastWriter writer;
- const char *json = writer.write(data).c_str();
+ std::string json = writer.write(data);
// Send HTTP reply to the client
mg_printf(conn,
"HTTP/1.1 200 OK\r\n"
@@ -77,7 +77,7 @@ int web_engine::json_game_handler(struct mg_connection *conn)
"Content-Length: %d\r\n" // Always set Content-Length
"\r\n"
"%s",
- (int)strlen(json), json);
+ (int)json.length(), json.c_str());
// Returning non-zero tells mongoose that our function has replied to
// the client, and mongoose should not send client any more data.
@@ -119,7 +119,7 @@ int web_engine::json_slider_handler(struct mg_connection *conn)
array.append(data);
}
Json::FastWriter writer;
- const char *json = writer.write(array).c_str();
+ std::string json = writer.write(array);
// Send HTTP reply to the client
mg_printf(conn,
"HTTP/1.1 200 OK\r\n"
@@ -127,7 +127,7 @@ int web_engine::json_slider_handler(struct mg_connection *conn)
"Content-Length: %d\r\n" // Always set Content-Length
"\r\n"
"%s",
- (int)strlen(json), json);
+ (int)json.length(), json.c_str());
return MG_TRUE;
}