mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Fix the snprintf size issue.
This commit is contained in:
parent
1ab584b2ae
commit
a71eddd56a
10 changed files with 46 additions and 17 deletions
|
@ -1386,7 +1386,7 @@ string srs_string_dumps_hex(const char* str, int length, int limit, char seperat
|
|||
int len = 0;
|
||||
for (int i = 0; i < length && i < limit && len < LIMIT; ++i) {
|
||||
int nb = snprintf(buf + len, LIMIT - len, "%02x", (uint8_t)str[i]);
|
||||
if (nb < 0 || nb >= LIMIT - len) {
|
||||
if (nb <= 0 || nb >= LIMIT - len) {
|
||||
break;
|
||||
}
|
||||
len += nb;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue