#1 fix type mismatch
Merged a year ago by fab. Opened a year ago by rebus.
rpms/ rebus/tcptrack rawhide  into  rawhide

fix type mismatch
nobody • a year ago  
@@ -0,0 +1,38 @@ 

+ https://github.com/bchretien/tcptrack/commit/409007afbce8ec5a81312a2a4123dd83b62b4494.patch#/tcptrack-1.4.3-type-mismatch.patch

+ From 409007afbce8ec5a81312a2a4123dd83b62b4494 Mon Sep 17 00:00:00 2001

+ From: Sergei Trofimovich <slyich@gmail.com>

+ Date: Fri, 19 Nov 2021 08:49:56 +0000

+ Subject: [PATCH] src/TextUI.cc: fix format arguments

+ 

+ -Wformat detects type mismatch as:

+ 

+     TextUI.cc:315:34: error: format '%d' expects argument of type 'int',

+         but argument 2 has type 'time_t' {aka 'long int'} [-Werror=format=]

+       315 |                         printw("%ds",ic->getIdleSeconds());

+           |                                 ~^   ~~~~~~~~~~~~~~~~~~~~

+           |                                  |                     |

+           |                                  int                   time_t {aka long int}

+           |                                 %ld

+ ---

+  src/TextUI.cc | 6 +++---

+  1 file changed, 3 insertions(+), 3 deletions(-)

+ 

+ diff -ru tcptrack-1.4.3/src/TextUI.cc tcptrack-1.4.3.new/src/TextUI.cc

+ --- tcptrack-1.4.3/src/TextUI.cc	2015-04-23 10:04:40.000000000 +0200

+ +++ tcptrack-1.4.3.new/src/TextUI.cc	2023-01-20 09:34:15.223578489 +0100

+ @@ -309,11 +309,11 @@

+  

+  		move(row,58);

+  		if( ic->getIdleSeconds() < 60 )

+ -			printw("%ds",ic->getIdleSeconds());

+ -		else if( ic->getIdleSeconds() > 59 ) 

+ -			printw("%dm",ic->getIdleSeconds()/60);

+ +			printw("%ds",(int)(ic->getIdleSeconds()));

+ +		else if( ic->getIdleSeconds() > 59 )

+ +			printw("%dm",(int)(ic->getIdleSeconds()/60));

+  		else if( ic->getIdleSeconds() > 3559 )

+ -			printw("%dh",ic->getIdleSeconds()/3600);

+ +			printw("%ldh",(long)(ic->getIdleSeconds()/3600));

+  

+  		move(row,63);

+  		if( ic->activityToggle() )

file modified
+9 -1
@@ -7,6 +7,11 @@ 

  URL:            https://github.com/bchretien/tcptrack

  Source0:        https://github.com/bchretien/tcptrack/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz

  

+ # Build on F36+ has stronger argument type checking and needs this patch

+ # was already reported upstream in https://github.com/bchretien/tcptrack/pull/10/

+ # line changed

+ Patch0:         https://github.com/bchretien/tcptrack/commit/409007afbce8ec5a81312a2a4123dd83b62b4494.patch#/tcptrack-1.4.3-type-mismatch.patch

+ 

  BuildRequires: make

  BuildRequires:  gcc-c++

  BuildRequires:  gcc
@@ -22,7 +27,7 @@ 

  and bandwidth usage

  

  %prep

- %autosetup

+ %autosetup -p 1

  

  %build

  %configure
@@ -38,6 +43,9 @@ 

  %{_mandir}/man*/%{name}.*

  

  %changelog

+ * Thu Jan 19 2023 Michal Ambroz <rebus _AT seznam.cz> - 1.4.3-11

+ - cherrypick patch to fix format typs

+ 

  * Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.3-10

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

  

Hello,
this patch is fixing type mismatch, which hopefully should fix FTBS https://bugzilla.redhat.com/show_bug.cgi?id=2047036
I offer a hand maintaining the package.
Michal Ambroz

Pull-Request has been merged by fab

a year ago