diff options
Diffstat (limited to 'usr.bin/indent/indent_globs.h')
-rw-r--r-- | usr.bin/indent/indent_globs.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/usr.bin/indent/indent_globs.h b/usr.bin/indent/indent_globs.h index 9f319e0..c189bfd 100644 --- a/usr.bin/indent/indent_globs.h +++ b/usr.bin/indent/indent_globs.h @@ -58,6 +58,8 @@ FILE *output; /* the output file */ if (e_code >= l_code) { \ int nsize = l_code-s_code+400; \ codebuf = (char *) realloc(codebuf, nsize); \ + if (codebuf == NULL) \ + err(1, NULL); \ e_code = codebuf + (e_code-s_code) + 1; \ l_code = codebuf + nsize - 5; \ s_code = codebuf + 1; \ @@ -66,6 +68,8 @@ FILE *output; /* the output file */ if (e_com >= l_com) { \ int nsize = l_com-s_com+400; \ combuf = (char *) realloc(combuf, nsize); \ + if (combuf == NULL) \ + err(1, NULL); \ e_com = combuf + (e_com-s_com) + 1; \ l_com = combuf + nsize - 5; \ s_com = combuf + 1; \ @@ -74,6 +78,8 @@ FILE *output; /* the output file */ if (e_lab >= l_lab) { \ int nsize = l_lab-s_lab+400; \ labbuf = (char *) realloc(labbuf, nsize); \ + if (labbuf == NULL) \ + err(1, NULL); \ e_lab = labbuf + (e_lab-s_lab) + 1; \ l_lab = labbuf + nsize - 5; \ s_lab = labbuf + 1; \ @@ -82,6 +88,8 @@ FILE *output; /* the output file */ if (e_token >= l_token) { \ int nsize = l_token-s_token+400; \ tokenbuf = (char *) realloc(tokenbuf, nsize); \ + if (tokenbuf == NULL) \ + err(1, NULL); \ e_token = tokenbuf + (e_token-s_token) + 1; \ l_token = tokenbuf + nsize - 5; \ s_token = tokenbuf + 1; \ |