coverity issue

This commit is contained in:
yihaoDeng 2020-07-16 19:33:26 +00:00
parent 342fa8882c
commit f8818e5b75
1 changed files with 4 additions and 1 deletions

View File

@ -239,7 +239,10 @@ char* strntolower(char *dst, const char *src, int32_t n) {
char quote = 0, *p = dst, c;
assert(dst != NULL);
if (n == 0) {
*p = 0;
return dst;
}
for (c = *src++; n-- > 0; c = *src++) {
if (esc) {
esc = 0;