Source: nn
Version: 6.7.3-14
Severity: normal
Tags: patch

Dear Maintainer,

>From a54bc2423dd39d33a8c5e3cacc8a41e5874516ea Mon Sep 17 00:00:00 2001
>From: Bjarni Ingi Gislason <bjarn...@rhi.hi.is>
>Date: Sat, 6 Mar 2021 21:28:54 +0000
>Subject: [PATCH] group.c: fix some warnings issued by the compiler and add
> other changes.

  Include header file "group.h" for prototypes.

  Change the name of the variable "NDELAYED_MSG" to lower case
"ndelayed_msg".

  Fix the declaration of the last parameter of the function
"group_menu()" from "fct_type menu" to "int (* menu) (fct_type_void)".

  Use "snprintf()" instead of "sprintf()".

Signed-off-by: Bjarni Ingi Gislason <bjarn...@rhi.hi.is>
---
 group.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/group.c b/group.c
index 8819d52..44fd67f 100644
--- a/group.c
+++ b/group.c
@@ -14,6 +14,7 @@
 #include "articles.h"
 #include "db.h"
 #include "folder.h"
+#include "group.h"
 #include "macro.h"
 #include "match.h"
 #include "menu.h"
@@ -52,7 +53,7 @@ extern int      killed_articles;
 extern int      seq_cross_filtering;
 extern char    *default_save_file, *folder_save_file;
 
-extern const size_t NDELAYED_MSG;
+extern const size_t ndelayed_msg;
 extern char     delayed_msg[];
 extern int32    db_read_counter;
 
@@ -210,7 +211,10 @@ print_header(void)
  */
 
 int
-group_menu(register group_header * gh, article_number first_art, register 
flag_type access_mode, char *mask, fct_type menu)
+group_menu(register group_header * gh, article_number first_art,
+           register flag_type access_mode, char *mask,
+          int (* menu) (fct_type_void) )
+
 {
     register group_header *mg_head;
     article_number  was_unread;
@@ -763,7 +767,7 @@ get_group_name:
            if (!get_from_macro) {
                prompt("\1Number of extra articles\1 max %ld: ",
                       gh->current_first - gh->first_db_article);
-               sprintf(buffer, "%c", ans1);
+               snprintf(buffer, FILENAME, "%c", ans1);
                answer = get_s(NONE, buffer, NONE, NULL_FCT);
                if (answer == NULL || *answer == NUL)
                    goto_return(ME_NO_REDRAW);
@@ -1160,7 +1164,7 @@ merge_and_read(flag_type access_mode, char *mask)
     current_group = &dummy_group;
 
     kb = (kb + 1023) >> 10;
-    snprintf(delayed_msg, NDELAYED_MSG, "Read %ld articles in %ld seconds (%ld 
kbyte/s)",
+    snprintf(delayed_msg, ndelayed_msg, "Read %ld articles in %ld seconds (%ld 
kbyte/s)",
            (long) db_read_counter, (long) t2, t2 > 0 ? kb / t2 : kb);
 
     menu(merged_header);
-- 
2.30.1



-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.9-1 (SMP w/2 CPU threads)
Locale: LANG=is_IS.iso88591, LC_CTYPE=is_IS.iso88591 (charmap=ISO-8859-1), 
LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

-- debconf information excluded

-- 
Bjarni I. Gislason

Reply via email to