[PATCH] man/man3/strftime.3: Check parameter
From: <hidden>
Date: 2025-08-18 16:56:55
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: <hidden>
Date: 2025-08-18 16:56:55
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: "Dr. David Alan Gilbert" <redacted> The strftime example requires a format paramter. If you don't pass one it crashes. Check for the parameter. Signed-off-by: Dr. David Alan Gilbert <redacted> --- man/man3/strftime.3 | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/man/man3/strftime.3 b/man/man3/strftime.3
index 4a3f805bb..3c1108b36 100644
--- a/man/man3/strftime.3
+++ b/man/man3/strftime.3@@ -739,6 +739,11 @@ .SS Program source char outstr[200]; time_t t; struct tm *tmp; +\& + if (argc != 2) { + fprintf(stderr,"%s: format-string\[rs]n", argv[0]); + exit(EXIT_FAILURE); + } \& t = time(NULL); tmp = localtime(&t);
--
2.50.1