* [PATCH] bsearch.3: Declare variables with different types in different lines
@ 2020-09-07 21:27 Alejandro Colomar
2020-09-08 5:26 ` Michael Kerrisk (man-pages)
0 siblings, 1 reply; 2+ messages in thread
From: Alejandro Colomar @ 2020-09-07 21:27 UTC (permalink / raw)
To: mtk.manpages; +Cc: linux-man, Alejandro Colomar
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
---
man3/bsearch.3 | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/man3/bsearch.3 b/man3/bsearch.3
index 9d4f76da5..c429e4ac1 100644
--- a/man3/bsearch.3
+++ b/man3/bsearch.3
@@ -124,7 +124,9 @@ main(int argc, char **argv)
{
qsort(months, nr_of_months, sizeof(months[0]), compmi);
for (int i = 1; i < argc; i++) {
- struct mi key, *res;
+ struct mi key;
+ struct mi *res;
+
key.name = argv[i];
res = bsearch(&key, months, nr_of_months,
sizeof(months[0]), compmi);
--
2.28.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] bsearch.3: Declare variables with different types in different lines
2020-09-07 21:27 [PATCH] bsearch.3: Declare variables with different types in different lines Alejandro Colomar
@ 2020-09-08 5:26 ` Michael Kerrisk (man-pages)
0 siblings, 0 replies; 2+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-09-08 5:26 UTC (permalink / raw)
To: Alejandro Colomar; +Cc: mtk.manpages, linux-man
On 9/7/20 11:27 PM, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
> ---
> man3/bsearch.3 | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
Thanks, Alex. Patch applied.
Cheers,
Michael
> diff --git a/man3/bsearch.3 b/man3/bsearch.3
> index 9d4f76da5..c429e4ac1 100644
> --- a/man3/bsearch.3
> +++ b/man3/bsearch.3
> @@ -124,7 +124,9 @@ main(int argc, char **argv)
> {
> qsort(months, nr_of_months, sizeof(months[0]), compmi);
> for (int i = 1; i < argc; i++) {
> - struct mi key, *res;
> + struct mi key;
> + struct mi *res;
> +
> key.name = argv[i];
> res = bsearch(&key, months, nr_of_months,
> sizeof(months[0]), compmi);
>
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-09-08 5:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-07 21:27 [PATCH] bsearch.3: Declare variables with different types in different lines Alejandro Colomar
2020-09-08 5:26 ` Michael Kerrisk (man-pages)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox