diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2016-11-21 13:00:54 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2016-11-21 13:00:54 +0200 |
commit | 4e9e225408eeaa1f161ae366f68715529bea2d2a (patch) | |
tree | 9b85b13b3578c724b67a820df551aa785e1d41b7 /src | |
parent | c2f02c56a38a3e6d50b8ca2081db9d2de658b8ed (diff) | |
download | grecs-4e9e225408eeaa1f161ae366f68715529bea2d2a.tar.gz grecs-4e9e225408eeaa1f161ae366f68715529bea2d2a.tar.bz2 |
Bugfixes
* src/jsonfmt.c (json_format_obj): Use grecs_symtab_count and
grecs_symtab_foreach.
* src/wordsplit.c: Always pass format strings as first argument
to wsp->ws_error.
Diffstat (limited to 'src')
-rw-r--r-- | src/jsonfmt.c | 4 | ||||
-rw-r--r-- | src/wordsplit.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/jsonfmt.c b/src/jsonfmt.c index 9ccac37..9d900ca 100644 --- a/src/jsonfmt.c +++ b/src/jsonfmt.c | |||
@@ -124,10 +124,10 @@ json_format_obj(struct json_format *fmt, struct json_value *obj, size_t level) | |||
124 | size_t count, i; | 124 | size_t count, i; |
125 | struct json_pair **keypairs, **kp; | 125 | struct json_pair **keypairs, **kp; |
126 | 126 | ||
127 | count = grecs_symtab_count_entries(obj->v.o); | 127 | count = grecs_symtab_count(obj->v.o); |
128 | keypairs = grecs_calloc(count, sizeof(*keypairs)); | 128 | keypairs = grecs_calloc(count, sizeof(*keypairs)); |
129 | kp = keypairs; | 129 | kp = keypairs; |
130 | grecs_symtab_enumerate(obj->v.o, collect_keypairs, &kp); | 130 | grecs_symtab_foreach(obj->v.o, collect_keypairs, &kp); |
131 | qsort(keypairs, count, sizeof(*keypairs), keypair_cmp_name); | 131 | qsort(keypairs, count, sizeof(*keypairs), keypair_cmp_name); |
132 | 132 | ||
133 | json_writec(fmt, '{'); | 133 | json_writec(fmt, '{'); |
diff --git a/src/wordsplit.c b/src/wordsplit.c index e326c8c..9381ae7 100644 --- a/src/wordsplit.c +++ b/src/wordsplit.c | |||
@@ -59,7 +59,7 @@ | |||
59 | static void | 59 | static void |
60 | _wsplt_alloc_die (struct wordsplit *wsp) | 60 | _wsplt_alloc_die (struct wordsplit *wsp) |
61 | { | 61 | { |
62 | wsp->ws_error (_("memory exhausted")); | 62 | wsp->ws_error ("%s", _("memory exhausted")); |
63 | abort (); | 63 | abort (); |
64 | } | 64 | } |
65 | 65 | ||
@@ -2330,7 +2330,7 @@ wordsplit_perror (struct wordsplit *wsp) | |||
2330 | break; | 2330 | break; |
2331 | 2331 | ||
2332 | default: | 2332 | default: |
2333 | wsp->ws_error (wordsplit_strerror (wsp)); | 2333 | wsp->ws_error ("%s", wordsplit_strerror (wsp)); |
2334 | } | 2334 | } |
2335 | } | 2335 | } |
2336 | 2336 | ||