diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-10-30 18:50:11 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-10-30 18:50:11 +0000 |
commit | 314f1f1e699245ecd79579db7c40c4fa85b0d484 (patch) | |
tree | 83b506322728dc6a507484557d54518360fe5e07 /term.c | |
parent | 6743cd2838c98a6c8127771ac05c6695131f26f5 (diff) | |
download | mandoc-314f1f1e699245ecd79579db7c40c4fa85b0d484.tar.gz mandoc-314f1f1e699245ecd79579db7c40c4fa85b0d484.tar.zst mandoc-314f1f1e699245ecd79579db7c40c4fa85b0d484.zip |
Lint fixes.
Made realloc puke with fprintf.
Diffstat (limited to 'term.c')
-rw-r--r-- | term.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.117 2009/10/30 18:43:24 kristaps Exp $ */ +/* $Id: term.c,v 1.118 2009/10/30 18:50:11 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -543,8 +543,10 @@ buffer(struct termp *p, char c) p->maxcols = 256; s = p->maxcols * 2; p->buf = realloc(p->buf, s); - if (NULL == p->buf) - err(1, "realloc"); /* FIXME: shouldn't be here! */ + if (NULL == p->buf) { + fprintf(stderr, "memory exhausted\n"); + exit(EXIT_FAILURE); + } p->maxcols = s; } p->buf[(int)(p->col)++] = c; |