aboutsummaryrefslogtreecommitdiffstats
path: root/src/ucl/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/ucl/utils')
-rw-r--r--src/ucl/utils/chargen.c4
-rw-r--r--src/ucl/utils/objdump.c13
2 files changed, 10 insertions, 7 deletions
diff --git a/src/ucl/utils/chargen.c b/src/ucl/utils/chargen.c
index 724b37899..d6fa86a20 100644
--- a/src/ucl/utils/chargen.c
+++ b/src/ucl/utils/chargen.c
@@ -98,6 +98,10 @@ main (int argc, char **argv)
i == '"' || i == '\f') {
r += print_flag ("UCL_CHARACTER_JSON_UNSAFE", &need_or, valbuf + r);
}
+ if (i == '\n' || i == '\r' || i == '\\' || i == '\b' || i == '\t' ||
+ i == '"' || i == '\f' || i == '=' || i == ':' || i == '{' || i == '[' || i == ' ') {
+ r += print_flag ("UCL_CHARACTER_UCL_UNSAFE", &need_or, valbuf + r);
+ }
if (!need_or) {
r += print_flag ("UCL_CHARACTER_DENIED", &need_or, valbuf + r);
diff --git a/src/ucl/utils/objdump.c b/src/ucl/utils/objdump.c
index 985106a09..8ba0ac261 100644
--- a/src/ucl/utils/objdump.c
+++ b/src/ucl/utils/objdump.c
@@ -95,7 +95,6 @@ main(int argc, char **argv)
const char *fn = NULL;
char inbuf[8192];
struct ucl_parser *parser;
- UT_string *err = NULL;
int k, ret = 0;
ucl_object_t *obj = NULL;
ucl_object_t *par;
@@ -118,18 +117,18 @@ main(int argc, char **argv)
parser = ucl_parser_new (0);
while (!feof (in)) {
fread (inbuf, sizeof (inbuf), 1, in);
- ucl_parser_add_chunk (parser, inbuf, strlen (inbuf), &err);
+ ucl_parser_add_chunk (parser, inbuf, strlen (inbuf));
}
fclose (in);
- if (err != NULL ) {
- printf ("Error occured: %s\n", err->d);
+ if (ucl_parser_get_error(parser) ) {
+ printf ("Error occured: %s\n", ucl_parser_get_error(parser));
ret = 1;
goto end;
}
- obj = ucl_parser_get_object (parser, &err);
- if (err != NULL ) {
- printf ("Error occured: %s\n", err->d);
+ obj = ucl_parser_get_object (parser);
+ if (ucl_parser_get_error(parser)) {
+ printf ("Error occured: %s\n", ucl_parser_get_error(parser));
ret = 1;
goto end;
}