Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
May 14, 2023

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants