mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-18 08:20:44 +00:00
Userland: Prefer strlcpy over strcpy in ping
This is supposed to serve as a reminder if and when someone decides to make the 'msg' field configurable.
This commit is contained in:
parent
5c1a72f0ef
commit
cb52bfdd27
Notes:
sideshowbarker
2024-07-19 03:14:06 +09:00
Author: https://github.com/BenWiederhake
Commit: cb52bfdd27
Pull-request: https://github.com/SerenityOS/serenity/pull/3275
Reviewed-by: https://github.com/awesomekling
1 changed files with 1 additions and 1 deletions
|
@ -125,7 +125,7 @@ int main(int argc, char** argv)
|
||||||
ping_packet.header.code = 0;
|
ping_packet.header.code = 0;
|
||||||
ping_packet.header.un.echo.id = htons(pid);
|
ping_packet.header.un.echo.id = htons(pid);
|
||||||
ping_packet.header.un.echo.sequence = htons(seq++);
|
ping_packet.header.un.echo.sequence = htons(seq++);
|
||||||
strcpy(ping_packet.msg, "Hello there!\n");
|
strlcpy(ping_packet.msg, "Hello there!\n", sizeof(ping_packet.msg));
|
||||||
|
|
||||||
ping_packet.header.checksum = internet_checksum(&ping_packet, sizeof(PingPacket));
|
ping_packet.header.checksum = internet_checksum(&ping_packet, sizeof(PingPacket));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue