Skip to content

Conversation

@u5surf
Copy link

@u5surf u5surf commented Sep 28, 2025

  • sprintf -> snprintf in test.c

I found build warnings on MacOS. so I fixed with snprintf following warning message.

% make test
cc -Wall -fsanitize=address,undefined  -o test-bin picohttpparser.c picotest/picotest.c test.c
test.c:480:25: 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]
        bufsz = (size_t)sprintf(buf, "%zx%s\r\n", chunk_len, extra);
                        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/_stdio.h:274:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("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.")
^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/sys/cdefs.h:218:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
1 warning generated.

* sprintf -> snprintf in test.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant