summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-analyzer/gnu-netcat/files/gnu-netcat-flagcount.patch')
-rw-r--r--net-analyzer/gnu-netcat/files/gnu-netcat-flagcount.patch22
1 files changed, 22 insertions, 0 deletions
diff --git a/net-analyzer/gnu-netcat/files/gnu-netcat-flagcount.patch b/net-analyzer/gnu-netcat/files/gnu-netcat-flagcount.patch
new file mode 100644
index 000000000000..765212cb0e99
--- /dev/null
+++ b/net-analyzer/gnu-netcat/files/gnu-netcat-flagcount.patch
@@ -0,0 +1,22 @@
+--- a/src/flagset.c
++++ b/src/flagset.c
+@@ -134,7 +134,7 @@
+
+ int netcat_flag_count(void)
+ {
+- register char c;
++ register unsigned char c;
+ register int i;
+ int ret = 0;
+
+@@ -154,8 +154,8 @@
+ Assumed that the bit number 1 is the sign, and that we will shift the
+ bit 1 (or the bit that takes its place later) until the the most right,
+ WHY it has to keep the wrong sign? */
+- ret -= (c >> 7);
+- c <<= 1;
++ ret += (c & 1);
++ c >>= 1;
+ }
+ }
+