X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Ftypes%2Fconst.c;h=449f04a1221e493e366d392825f7fb47d7eea477;hp=a40a0e2b0eb35a86e07b5fafae391c299acbb7aa;hb=f74ce3f29e2dadd9f839c33ad5292e56e9203efd;hpb=9bcb1df0786a8193d65949c857baaba2f4296e84 diff --git a/src/types/const.c b/src/types/const.c index a40a0e2..449f04a 100644 --- a/src/types/const.c +++ b/src/types/const.c @@ -31,7 +31,7 @@ struct psi_const *psi_const_init(struct psi_const_type *type, const char *name, { struct psi_const *c = calloc(1, sizeof(*c)); c->type = type; - c->name = strdup(name); + c->name = strdup(name[0] == '\\' ? &name[1] : name); c->val = val; return c; } @@ -63,6 +63,8 @@ void psi_const_dump(int fd, struct psi_const *cnst) bool psi_const_validate(struct psi_data *data, struct psi_const *c) { - /* FIXME */ + if (!psi_impl_def_val_validate(data, c->val, c->type->type, c->type->name)) { + return false; + } return true; }