Skip to content

Conversation

@chundonglinlin
Copy link
Member

@chundonglinlin chundonglinlin commented May 7, 2023

  • Replaced all occurrences of sprintf with snprintf to address deprecation warnings
  • Ensured proper buffer size is passed to snprintf to prevent potential buffer overflows
  • Ran tests to confirm that the changes do not introduce any new issues or regressions

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);

@winlinvip winlinvip changed the title Compile: Use snprintf instead of sprintf. Replace sprintf with snprintf to eliminate compile warnings May 14, 2023
@winlinvip winlinvip changed the title Replace sprintf with snprintf to eliminate compile warnings Replace sprintf with snprintf to eliminate compile warnings. v6.0.45 May 14, 2023
@winlinvip winlinvip merged commit c0e931a into ossrs:develop May 14, 2023
johzzy pushed a commit to johzzy/srs that referenced this pull request Jun 26, 2023
…ssrs#3534)

* Replaced all occurrences of sprintf with snprintf to address deprecation warnings
* Ensured proper buffer size is passed to snprintf to prevent potential buffer overflows
* Ran tests to confirm that the changes do not introduce any new issues or regressions

---------

Co-authored-by: ChenGH <chengh_math@126.com>
@winlinvip winlinvip added the EnglishNative This issue is conveyed exclusively in English. label Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

EnglishNative This issue is conveyed exclusively in English.

Development

Successfully merging this pull request may close these issues.

3 participants