1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:17:35 +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:
Ben Wiederhake 2020-08-23 15:55:49 +02:00 committed by Andreas Kling
parent 5c1a72f0ef
commit cb52bfdd27

View file

@ -125,7 +125,7 @@ int main(int argc, char** argv)
ping_packet.header.code = 0;
ping_packet.header.un.echo.id = htons(pid);
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));