From a8591bcd8b5585e3de774a715802be3434f8cfe7 Mon Sep 17 00:00:00 2001 From: Jens Reidel Date: Fri, 5 Dec 2025 16:18:03 +0100 Subject: [PATCH] Use getopt_long for opt parsing in ping Signed-off-by: Jens Reidel --- ping/ping.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ping/ping.c b/ping/ping.c index 1e976a9..1993fc7 100644 --- a/ping/ping.c +++ b/ping/ping.c @@ -54,6 +54,7 @@ #include "ping.h" #include +#include #include #include #include @@ -390,7 +391,7 @@ main(int argc, char **argv) } /* Parse command line options */ - while ((ch = getopt(argc, argv, "h?" "4bRT:" "6F:N:" "3aABc:CdDe:fHi:I:l:Lm:M:nOp:qQ:rs:S:t:UvVw:W:")) != EOF) { + while ((ch = getopt_long(argc, argv, "h?" "4bRT:" "6F:N:" "3aABc:CdDe:fHi:I:l:Lm:M:nOp:qQ:rs:S:t:UvVw:W:", NULL, NULL)) != EOF) { switch(ch) { /* IPv4 specific options */ case '4': -- 2.52.0