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
|
@ -1582,8 +1582,8 @@ string SrsJsonAny::dumps()
|
|||
}
|
||||
case SRS_JSON_Number: {
|
||||
// len(max int64_t) is 20, plus one "+-."
|
||||
char tmp[22];
|
||||
snprintf(tmp, 22, "%.2f", to_number());
|
||||
char tmp[21 + 1];
|
||||
snprintf(tmp, sizeof(tmp), "%.2f", to_number());
|
||||
return tmp;
|
||||
}
|
||||
case SRS_JSON_Null: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue