aboutsummaryrefslogtreecommitdiff
path: root/lib/sl/slc-gram.y
diff options
context:
space:
mode:
authorHiroki Sato <hrs@FreeBSD.org>2018-04-04 04:21:19 +0000
committerHiroki Sato <hrs@FreeBSD.org>2018-04-04 04:21:19 +0000
commitd684f11da759490a8d98d7b790796106285f4084 (patch)
tree27b7356df710fdf1440fe2c23154b8121e99f2ab /lib/sl/slc-gram.y
parentf52d4664e3f68828c06f85bfc1afa271e3e04713 (diff)
Import Heimdal 7.5.0.vendor/heimdal/7.5.0
Notes
Notes: svn path=/vendor-crypto/heimdal/dist/; revision=331978 svn path=/vendor-crypto/heimdal/7.5.0/; revision=331979; tag=vendor/heimdal/7.5.0
Diffstat (limited to 'lib/sl/slc-gram.y')
-rw-r--r--lib/sl/slc-gram.y18
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/sl/slc-gram.y b/lib/sl/slc-gram.y
index 530b1a344776..31ec6bc24de4 100644
--- a/lib/sl/slc-gram.y
+++ b/lib/sl/slc-gram.y
@@ -328,6 +328,7 @@ gen_command(struct assignment *as)
cprint(1, " { ");
fprintf(cfile, "\"%s\", ", a->u.value);
fprintf(cfile, "%s_wrap, ", f);
+ free(f);
b = find(as, "argument");
if(b)
fprintf(cfile, "\"%s %s\", ", a->u.value, b->u.value);
@@ -341,7 +342,7 @@ gen_command(struct assignment *as)
fprintf(cfile, " },\n");
for(a = a->next; a != NULL; a = a->next)
if(strcmp(a->name, "name") == 0)
- cprint(1, " { \"%s\" },\n", a->u.value);
+ cprint(1, " { \"%s\", NULL, NULL, NULL },\n", a->u.value);
cprint(0, "\n");
}
@@ -360,6 +361,7 @@ make_name(struct assignment *as)
struct assignment *lopt;
struct assignment *type;
char *s;
+ int ret;
lopt = find(as, "long");
if(lopt == NULL)
@@ -369,9 +371,11 @@ make_name(struct assignment *as)
type = find(as, "type");
if(strcmp(type->u.value, "-flag") == 0)
- asprintf(&s, "%s_flag", lopt->u.value);
+ ret = asprintf(&s, "%s_flag", lopt->u.value);
else
- asprintf(&s, "%s_%s", lopt->u.value, type->u.value);
+ ret = asprintf(&s, "%s_%s", lopt->u.value, type->u.value);
+ if (ret == -1)
+ return NULL;
gen_name(s);
return s;
}
@@ -446,7 +450,7 @@ struct type_handler {
defval_neg_flag,
NULL
},
- { NULL }
+ { NULL, NULL, NULL, NULL, NULL }
};
static struct type_handler *find_handler(struct assignment *type)
@@ -710,7 +714,7 @@ gen(struct assignment *as)
cprint(0, "SL_cmd commands[] = {\n");
for(a = as; a != NULL; a = a->next)
gen_command(a->u.assignment);
- cprint(1, "{ NULL }\n");
+ cprint(1, "{ NULL, NULL, NULL, NULL }\n");
cprint(0, "};\n");
hprint(0, "extern SL_cmd commands[];\n");
@@ -719,8 +723,8 @@ gen(struct assignment *as)
int version_flag;
int help_flag;
struct getargs args[] = {
- { "version", 0, arg_flag, &version_flag },
- { "help", 0, arg_flag, &help_flag }
+ { "version", 0, arg_flag, &version_flag, NULL, NULL },
+ { "help", 0, arg_flag, &help_flag, NULL, NULL }
};
int num_args = sizeof(args) / sizeof(args[0]);