]> git.pld-linux.org Git - packages/ykpers.git/blob - ykpers-json-c.patch
- added json-c patch (fixes build with json-c 0.14); release 2
[packages/ykpers.git] / ykpers-json-c.patch
1 --- ykpers-1.20.0/ykpers-json.c.orig    2019-02-19 13:29:54.000000000 +0100
2 +++ ykpers-1.20.0/ykpers-json.c 2020-05-01 21:45:21.661700644 +0200
3 @@ -40,7 +40,7 @@
4  #define yk_json_object_object_get(obj, key, value) json_object_object_get_ex(obj, key, &value)
5  #else
6  typedef int json_bool;
7 -#define yk_json_object_object_get(obj, key, value) (value = json_object_object_get(obj, key)) == NULL ? (json_bool)FALSE : (json_bool)TRUE
8 +#define yk_json_object_object_get(obj, key, value) (value = json_object_object_get(obj, key)) == NULL ? (json_bool)0 : (json_bool)1
9  #endif
10  
11  static void set_json_value(struct map_st *p, int mode, json_object *options, YKP_CONFIG *cfg) {
12 @@ -50,7 +50,7 @@
13         if(p->mode && (mode & p->mode) == mode) {
14                 json_object *joption;
15                 json_bool ret = yk_json_object_object_get(options, p->json_text, joption);
16 -               if(ret == TRUE && json_object_get_type(joption) == json_type_boolean) {
17 +               if(ret == 1 && json_object_get_type(joption) == json_type_boolean) {
18                         int value = json_object_get_boolean(joption);
19                         if(value == 1) {
20                                 p->setter(cfg, true);
21 @@ -230,20 +230,20 @@
22                         ykp_errno = YKP_EINVAL;
23                         goto out;
24                 }
25 -               if(yk_json_object_object_get(jobj, "yubiProdConfig", yprod_json) == FALSE) {
26 +               if(yk_json_object_object_get(jobj, "yubiProdConfig", yprod_json) == 0) {
27                         ykp_errno = YKP_EINVAL;
28                         goto out;
29                 }
30 -               if(yk_json_object_object_get(yprod_json, "mode", jmode) == FALSE) {
31 +               if(yk_json_object_object_get(yprod_json, "mode", jmode) == 0) {
32                         ykp_errno = YKP_EINVAL;
33                         goto out;
34                 }
35 -               if(yk_json_object_object_get(yprod_json, "options", options) == FALSE) {
36 +               if(yk_json_object_object_get(yprod_json, "options", options) == 0) {
37                         ykp_errno = YKP_EINVAL;
38                         goto out;
39                 }
40  
41 -               if(yk_json_object_object_get(yprod_json, "targetConfig", jtarget) == TRUE) {
42 +               if(yk_json_object_object_get(yprod_json, "targetConfig", jtarget) == 1) {
43                         int target_config = json_object_get_int(jtarget);
44                         int command;
45                         if(target_config == 1) {
46 @@ -275,13 +275,13 @@
47                 if(mode == MODE_OATH_HOTP) {
48                         json_object *jdigits, *jrandom;
49                         ykp_set_tktflag_OATH_HOTP(cfg, true);
50 -                       if(yk_json_object_object_get(options, "oathDigits", jdigits) == TRUE) {
51 +                       if(yk_json_object_object_get(options, "oathDigits", jdigits) == 1) {
52                                 int digits = json_object_get_int(jdigits);
53                                 if(digits == 8) {
54                                         ykp_set_cfgflag_OATH_HOTP8(cfg, true);
55                                 }
56                         }
57 -                       if(yk_json_object_object_get(options, "randomSeed", jrandom) == TRUE) {
58 +                       if(yk_json_object_object_get(options, "randomSeed", jrandom) == 1) {
59                                 int random = json_object_get_boolean(jrandom);
60                                 int seed = 0;
61                                 if(random == 1) {
62 @@ -290,7 +290,7 @@
63                                         goto out;
64                                 } else {
65                                         json_object *jseed;
66 -                                       if(yk_json_object_object_get(options, "fixedSeedvalue", jseed) == TRUE) {
67 +                                       if(yk_json_object_object_get(options, "fixedSeedvalue", jseed) == 1) {
68                                                 seed = json_object_get_int(jseed);
69                                         }
70                                 }
This page took 0.107497 seconds and 3 git commands to generate.