indent: Avoid using values of pointers that refer to deallocated space.

For now maintain the local style in this file.

Reviewed by:	jilles

Reference:
9099a9f17b

Differential Revision: https://reviews.freebsd.org/D6966  (Partial)
Submitted by:	Piotr Stefaniak
This commit is contained in:
Pedro F. Giffuni 2016-08-01 19:24:01 +00:00
parent 87ff568c26
commit 707e8dae2d

View File

@ -57,41 +57,46 @@ FILE *output; /* the output file */
#define CHECK_SIZE_CODE \
if (e_code >= l_code) { \
int nsize = l_code-s_code+400; \
int code_len = e_code-s_code; \
codebuf = (char *) realloc(codebuf, nsize); \
if (codebuf == NULL) \
err(1, NULL); \
e_code = codebuf + (e_code-s_code) + 1; \
e_code = codebuf + code_len + 1; \
l_code = codebuf + nsize - 5; \
s_code = codebuf + 1; \
}
#define CHECK_SIZE_COM \
if (e_com >= l_com) { \
int nsize = l_com-s_com+400; \
int com_len = e_com - s_com; \
int blank_pos = last_bl - s_com; \
combuf = (char *) realloc(combuf, nsize); \
if (combuf == NULL) \
err(1, NULL); \
e_com = combuf + (e_com-s_com) + 1; \
last_bl = combuf + (last_bl-s_com) + 1; \
e_com = combuf + com_len + 1; \
last_bl = combuf + blank_pos + 1; \
l_com = combuf + nsize - 5; \
s_com = combuf + 1; \
}
#define CHECK_SIZE_LAB \
if (e_lab >= l_lab) { \
int nsize = l_lab-s_lab+400; \
int label_len = e_lab - s_lab; \
labbuf = (char *) realloc(labbuf, nsize); \
if (labbuf == NULL) \
err(1, NULL); \
e_lab = labbuf + (e_lab-s_lab) + 1; \
e_lab = labbuf + label_len + 1; \
l_lab = labbuf + nsize - 5; \
s_lab = labbuf + 1; \
}
#define CHECK_SIZE_TOKEN \
if (e_token >= l_token) { \
int nsize = l_token-s_token+400; \
int token_len = e_token - s_token; \
tokenbuf = (char *) realloc(tokenbuf, nsize); \
if (tokenbuf == NULL) \
err(1, NULL); \
e_token = tokenbuf + (e_token-s_token) + 1; \
e_token = tokenbuf + token_len + 1; \
l_token = tokenbuf + nsize - 5; \
s_token = tokenbuf + 1; \
}