File: strings.patch

package info (click to toggle)
chkrootkit 0.58b-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,796 kB
  • sloc: sh: 187,095; ansic: 3,779; makefile: 103
file content (35 lines) | stat: -rw-r--r-- 899 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From: =?utf-8?q?Christian_G=C3=B6ttsche?= <cgzones@googlemail.com>
Date: Fri, 24 Jul 2020 16:20:33 +0200
Subject: strings-static

Fix compiler warnings in strings.c:
a) printmeindex should be of type size_t not int
b) do not set printmeindex to zero when printing last string

Forwarded: yes
(Forwarded by email: 21 Dec 2024)
---
 strings.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/strings.c b/strings.c
index 7a921ef..0957680 100644
--- a/strings.c
+++ b/strings.c
@@ -62,7 +62,7 @@ void strings(FILE *pf) {
   int sz;
   unsigned char *cdata;
   int nread;
-  int printmeindex;
+  size_t printmeindex;
   cdata = filebuf(pf,&sz);
   nread = fread(cdata, 1, sz, pf);
   printmeindex = 0;
@@ -91,7 +91,6 @@ void strings(FILE *pf) {
   if (printmeindex > 3) {
     printme[printmeindex++] = 0;
     printf("%s\n", printme);
-    printmeindex = 0;
   }
   free(cdata);
 }