提交 8909c2ce 编写于 作者: A Andy Polyakov

err/err.c: improve readability.

Reviewed-by: NRich Salz <rsalz@openssl.org>
上级 d3d880ce
......@@ -800,9 +800,7 @@ int ERR_pop_to_mark(void)
while (es->bottom != es->top
&& (es->err_flags[es->top] & ERR_FLAG_MARK) == 0) {
err_clear(es, es->top);
es->top -= 1;
if (es->top == -1)
es->top = ERR_NUM_ERRORS - 1;
es->top = es->top > 0 ? es->top - 1 : ERR_NUM_ERRORS - 1;
}
if (es->bottom == es->top)
......@@ -823,9 +821,7 @@ int ERR_clear_last_mark(void)
top = es->top;
while (es->bottom != top
&& (es->err_flags[top] & ERR_FLAG_MARK) == 0) {
top -= 1;
if (top == -1)
top = ERR_NUM_ERRORS - 1;
top = top > 0 ? top - 1 : ERR_NUM_ERRORS - 1;
}
if (es->bottom == top)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册