summaryrefslogtreecommitdiff
path: root/swaylock/main.c
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2017-12-14 01:30:54 +0100
committerFurkan Sahin <furkan-dev@proton.me>2017-12-14 01:30:54 +0100
commit7b692f06de1951ac3c00d955f847cd1cdea2ba33 (patch)
tree8a1a12a32a1d2c40bc4fdb43aa7205362438f65b /swaylock/main.c
parent730c74c475ee4587a280e6ffc6229edceca8fcf2 (diff)
Adaptions for API change in json-c v0.130.15.1
Lift restriction on json-c <= 0.12.1 ipc-server: Acquire ownership of referenced json_object properly When adding a referenced json_object with an unknown lifetime to another json_object, it must be done with a wrapped call to json_object_get() to acquire the ownership of that json_object.
Diffstat (limited to 'swaylock/main.c')
-rw-r--r--swaylock/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/swaylock/main.c b/swaylock/main.c
index 4b486461..3208a45b 100644
--- a/swaylock/main.c
+++ b/swaylock/main.c
@@ -3,7 +3,6 @@
#include <xkbcommon/xkbcommon.h>
#include <xkbcommon/xkbcommon-names.h>
#include <security/pam_appl.h>
-#include <json-c/json.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -14,6 +13,7 @@
#include <signal.h>
#include <stdbool.h>
#include <unistd.h>
+#include "sway_json_helper.h"
#include "client/window.h"
#include "client/registry.h"
#include "client/cairo.h"
@@ -583,7 +583,7 @@ int main(int argc, char **argv) {
for (i = 0; i < registry->outputs->length; ++i) {
if (displays_paths[i * 2] != NULL) {
- for (int j = 0;; ++j) {
+ for (json_ar_len_t j = 0;; ++j) {
if (j >= json_object_array_length(json_outputs)) {
sway_log(L_ERROR, "%s is not an extant output", displays_paths[i * 2]);
exit(EXIT_FAILURE);