]> diplodocus.org Git - nmh/blobdiff - sbr/fmt_compile.c
Reworked charstring_buffer_copy() to not use strdup() so that
[nmh] / sbr / fmt_compile.c
index dbd86631fd0b0b11aca0a47af91f5064e3e28946..9cec16a6031b784e6b1adbc66f4bbd1ed6c1101b 100644 (file)
@@ -160,6 +160,7 @@ static struct ftable functable[] = {
      { "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 },
@@ -283,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++;\
@@ -405,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");
@@ -562,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;