Skip to contentSkip to conversation

bsearch.3: Declare variables with different types in different lines

PATCH In review Alejandro Colomar 2 participants 2 messages Sep 7, 2020 – Sep 8, 2020 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bsearch.3: Declare variables with different types in different lines

---
 man3/bsearch.3 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
man3/bsearch.3 +3 -1
index 9d4f76da5..c429e4ac1 100644
@@ -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);
Signature · 1 line
2.28.0
#1 lore raw
Quoted 4 lines · Alejandro Colomar
---
 man3/bsearch.3 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Thanks, Alex. Patch applied.

Cheers,

Michael

Quoted 16 lines
man3/bsearch.3 +3 -1
index 9d4f76da5..c429e4ac1 100644
@@ -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);
Signature · 3 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/