• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/netcat/netcat-0.7.1-signed-bit-counting.patch
Nick LevertonNick Leverton committed 6c387f2e69120 Jul 2010
Raw file
Source viewDiff to previous
xxxxxxxxxx
 
# Fix the endian-specific bit-counting code so that it works.
# SF:1068324 "netcat_flag_count() fix"
#   http://sourceforge.net/tracker/?func=detail&aid=1205729&group_id=52204&atid=466046
# SF:1205729 "doen't work on arm linux platform":
#   http://sourceforge.net/tracker/?func=detail&aid=1068324&group_id=52204&atid=466046
​
Index: netcat-0.7.1/src/flagset.c
===================================================================
--- netcat-0.7.1.orig/src/flagset.c 2010-07-19 13:51:46.000000000 +0100
+++ netcat-0.7.1/src/flagset.c  2010-07-19 13:52:27.000000000 +0100
@@ -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;
     }
   }
 
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.