diff --git a/src/util/src/tutil.c b/src/util/src/tutil.c index c8df34e1cd4e71954bf9255cc1507b5bb82d519b..3764df4afce21bea608e1a33351a343defcf7752 100644 --- a/src/util/src/tutil.c +++ b/src/util/src/tutil.c @@ -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;