X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/f62ff135add5529166b3cbd8ab9347f0db7048bb..19d2ce8fb85c0b52bafa37db46f8b4a3f05c87a3:/sbr/fmt_compile.c diff --git a/sbr/fmt_compile.c b/sbr/fmt_compile.c index 3f170f31..9cec16a6 100644 --- a/sbr/fmt_compile.c +++ b/sbr/fmt_compile.c @@ -159,6 +159,8 @@ static struct ftable functable[] = { { "decodecomp", TF_COMP, FT_LS_DECODECOMP, 0, TFL_PUTS }, { "decode", TF_EXPR, FT_LS_DECODE, 0, TFL_PUTS }, { "trim", TF_EXPR, FT_LS_TRIM, 0, 0 }, + { "kilo", TF_EXPR, FT_LS_KILO, 0, TFL_PUTS }, + { "kibi", TF_EXPR, FT_LS_KIBI, 0, TFL_PUTS }, { "compval", TF_COMP, FT_LV_COMP, 0, TFL_PUTN }, { "compflag", TF_COMP, FT_LV_COMPFLAG, 0, TFL_PUTN }, { "num", TF_NUM, FT_LV_LIT, 0, TFL_PUTN }, @@ -282,7 +284,7 @@ static struct colormap colortable[] = { /* Add new component to the hash table */ #define NEWCOMP(cm,name) do { \ - cm = ((struct comp *) calloc(1, sizeof (struct comp)));\ + cm = ((struct comp *) mh_xcalloc (1, sizeof (struct comp)));\ cm->c_name = getcpy(name);\ cm->c_refcount++;\ ncomp++;\ @@ -404,7 +406,7 @@ fmt_compile(char *fstring, struct format **fmt, int reset_comptable) */ i = strlen(fstring)/2 + 1; if (i==1) i++; - next_fp = formatvec = (struct format *)calloc ((size_t) i, + next_fp = formatvec = (struct format *)mh_xcalloc ((size_t) i, sizeof(struct format)); if (next_fp == NULL) adios (NULL, "unable to allocate format storage"); @@ -561,7 +563,7 @@ do_name(char *sp, int preprocess) CERROR("component used as both date and address"); } cm->c_tws = (struct tws *) - calloc((size_t) 1, sizeof(*cm->c_tws)); + mh_xcalloc ((size_t) 1, sizeof(*cm->c_tws)); fp->f_type = preprocess; PUTCOMP(sp); cm->c_type |= CT_DATE;