ossrs / srs

SRS is a simple, high-efficiency, real-time media server supporting RTMP, WebRTC, HLS, HTTP-FLV, HTTP-TS, SRT, MPEG-DASH, and GB28181.
https://ossrs.io
MIT License
25.65k stars 5.38k forks source link

Replace sprintf with snprintf to eliminate compile warnings. v6.0.45 #3534

Closed chundonglinlin closed 1 year ago

chundonglinlin commented 1 year ago

Remove compile warnings by using snprintf instead of sprintf, likely

warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  
Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
sprintf(error, "%d:%d: Unknown value", line_and_col);