summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2021-03-10 10:46:10 +0200
committerMarius Vlad <marius.vlad@collabora.com>2021-03-10 14:39:10 +0200
commit75c22ca591142d1f9ec8ab030f561dd1b97cdb0d (patch)
treee0a494f00d84f7830552fd217625cbf39be6b871 /src
parent31eeddf43beed3dd5f6b85eb8f8c2f3e46f3e34c (diff)
hs-clientmanager: Pass arguments to printf() wrappers
Avoid crashing on various platforms, by not setting any argument at all. Bug-AGL: SPEC-3843 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ifb082b95fd6ebc71e863b843c9fd895f5f7efdde
Diffstat (limited to 'src')
-rw-r--r--src/hs-clientmanager.cpp8
-rw-r--r--src/hs-proxy.cpp2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/hs-clientmanager.cpp b/src/hs-clientmanager.cpp
index 8f02953..66fd699 100644
--- a/src/hs-clientmanager.cpp
+++ b/src/hs-clientmanager.cpp
@@ -172,8 +172,8 @@ is_application_running(afb_req_t request, std::string id)
afm_proxy.ps(request->api, &jobj);
if (jobj) {
- const int len = json_object_array_length(jobj);
- for (int i = 0; i < len; i++) {
+ size_t len = json_object_array_length(jobj);
+ for (size_t i = 0; i < len; i++) {
struct json_object *aid;
struct json_object *item =
json_object_array_get_idx(jobj, i);
@@ -236,11 +236,11 @@ int HS_ClientManager::handleRequest(afb_req_t request, const char *verb, const c
if (strcasecmp(verb, "showWindow") == 0) {
ret = is_application_running(request, id);
if (ret == AFB_REQ_NOT_STARTED_APPLICATION) {
- AFB_INFO("%s is not running. Will attempt to start it");
+ AFB_INFO("%s is not running. Will attempt to start it", appid);
return ret;
}
}
- AFB_INFO("%s found to be running. Forwarding request to the client");
+ AFB_INFO("%s found to be running. Forwarding request to the client", appid);
ret = ip->second->handleRequest(request, verb);
}
else {
diff --git a/src/hs-proxy.cpp b/src/hs-proxy.cpp
index f8b796c..aaa67c7 100644
--- a/src/hs-proxy.cpp
+++ b/src/hs-proxy.cpp
@@ -56,7 +56,7 @@ static void api_callback(void *closure, struct json_object *object, const char *
/* if we have an error then we couldn't start the application so we remove it */
if (error) {
- AFB_INFO("asynchronous call, removing client %s", cdata->appid);
+ AFB_INFO("asynchronous call, removing client %s", cdata->appid.c_str());
clientManager->removeClient(cdata->appid);
}