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

Dear Maintainer,

>From 3dfc43b569d405086b9c8affe32660ffa621cc32 Mon Sep 17 00:00:00 2001
>From: Bjarni Ingi Gislason <bjarn...@rhi.hi.is>
>Date: Fri, 2 Apr 2021 01:56:54 +0000
>Subject: [PATCH] db.c: move declaration of "*p" outside of a "while" and "if"
> construct

  The compiler reported:

db.c: In function 'readtimfile':
db.c:1428:11: warning: unused variable 'p' [-Wunused-variable]
 1428 |   char   *p = NULL;
      |           ^
db.c:1431:11: warning: unused variable 'p' [-Wunused-variable]
 1431 |   char   *p = strchr(line, ' ');
      |           ^
db.c:1433:6: error: 'p' undeclared (first use in this function)
 1433 |  if (p == NULL)
      |      ^

Signed-off-by: Bjarni Ingi Gislason <bjarn...@rhi.hi.is>
---
 db.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/db.c b/db.c
index 257ee5c..90221d0 100644
--- a/db.c
+++ b/db.c
@@ -1415,6 +1415,7 @@ readtimfile(void)
 
     tprintf("Reading the \"active.times\" file ... ");
     fflush(stdout);
+    char *p;
 #ifdef NNTP
     while (use_nntp ? nntp_fgets(timline, sizeof timline)
           : fgets(timline, sizeof timline, timfp))
@@ -1425,10 +1426,10 @@ readtimfile(void)
     {
        char   *line = strkeep(timline, 0, POOL_TIM);
        if (line == NULL) {
-               char   *p = NULL;
+               p = NULL;
        }
        else {
-               char   *p = strchr(line, ' ');
+               p = strchr(line, ' ');
        }
        if (p == NULL)
            continue;
-- 
2.30.2



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

Kernel: Linux 5.10.24-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