commit | 58bf3bf1afdc00c082d8b08fe810dc59d84209d9 | [log] [tgz] |
---|---|---|
author | Heyi Guo <guoheyi@linux.alibaba.com> | Wed Jan 20 13:55:25 2021 +0800 |
committer | Heyi Guo <guoheyi@linux.alibaba.com> | Wed Jan 20 14:16:04 2021 +0800 |
tree | 9c37d0283cc8410560a31f0568d0bbed46af02a9 | |
parent | 11a16c8aaaf4222b392ced4713dcb0ba8ba60e25 [diff] |
libc/snprintf: use macro to reduce duplicated code Add macro CHECK_AND_PUT_CHAR to check buffer capacity, save one character to buffer, and then increase character counter by one in one single statement, so that 4 similar code pieces can be cleaned. Signed-off-by: Heyi Guo <guoheyi@linux.alibaba.com> Change-Id: I2add6b4bd6c24ea3c0d2499a44924e3e8db0f4d1