[BACK]Return to chars.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/chars.c between version 1.9 and 1.10

version 1.9, 2009/09/23 11:02:21 version 1.10, 2009/10/30 18:43:24
Line 15 
Line 15 
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.   * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */   */
 #include <assert.h>  #include <assert.h>
 #include <err.h>  #include <stdio.h>
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
   
Line 89  chars_init(enum chars type)
Line 89  chars_init(enum chars type)
          * (they're in-line re-ordered during lookup).           * (they're in-line re-ordered during lookup).
          */           */
   
         if (NULL == (tab = malloc(sizeof(struct tbl))))          tab = malloc(sizeof(struct tbl));
                 err(1, "malloc");          if (NULL == tab) {
         tab->type = type;                  fprintf(stderr, "memory exhausted\n");
                   exit(EXIT_FAILURE);
           }
   
         htab = calloc(PRINT_HI - PRINT_LO + 1, sizeof(struct ln **));          htab = calloc(PRINT_HI - PRINT_LO + 1, sizeof(struct ln **));
         if (NULL == htab)          if (NULL == htab) {
                 err(1, "malloc");                  fprintf(stderr, "memory exhausted\n");
                   exit(EXIT_FAILURE);
           }
   
         for (i = 0; i < LINES_MAX; i++) {          for (i = 0; i < LINES_MAX; i++) {
                 hash = (int)lines[i].code[0] - PRINT_LO;                  hash = (int)lines[i].code[0] - PRINT_LO;
Line 111  chars_init(enum chars type)
Line 115  chars_init(enum chars type)
         }          }
   
         tab->htab = htab;          tab->htab = htab;
           tab->type = type;
         return(tab);          return(tab);
 }  }
   

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

CVSweb