diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2017-12-14 01:30:54 +0100 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2017-12-14 01:30:54 +0100 |
| commit | 7b692f06de1951ac3c00d955f847cd1cdea2ba33 (patch) | |
| tree | 8a1a12a32a1d2c40bc4fdb43aa7205362438f65b /swaybar/status_line.c | |
| parent | 730c74c475ee4587a280e6ffc6229edceca8fcf2 (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 'swaybar/status_line.c')
| -rw-r--r-- | swaybar/status_line.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/swaybar/status_line.c b/swaybar/status_line.c index 87e90caf..e3cc0bf4 100644 --- a/swaybar/status_line.c +++ b/swaybar/status_line.c @@ -2,8 +2,8 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> -#include <json-c/json.h> +#include "sway_json_helper.h" #include "swaybar/config.h" #include "swaybar/status_line.h" #include "log.h" @@ -70,8 +70,7 @@ static void parse_json(struct bar *bar, const char *text) { bar->status->block_line = create_list(); - int i; - for (i = 0; i < json_object_array_length(results); ++i) { + for (json_ar_len_t i = 0; i < json_object_array_length(results); ++i) { json_object *full_text, *short_text, *color, *min_width, *align, *urgent; json_object *name, *instance, *separator, *separator_block_width; json_object *background, *border, *border_top, *border_bottom; |
