Thread (7 messages) flat view 7 messages, 4 authors, 2016-06-15

Re: [PATCH] Fix signedness on return value from xread()

From: Shawn O. Pearce <hidden>
Date: 2016-06-15 22:43:10

Johan Herland [off-list ref] wrote:
The return value from xread() is ssize_t. 
Paolo Teti [off-list ref] pointed out that in this case, the 
signed return value was assigned to an unsigned type (size_t). This patch 
fixes that.
Thanks for fixing this.  Its rather embarrassing as:

  commit 00be8dcc1aca3c1c1a94b39f0563d30d1fa89290
  Author: Sami Farin [off-list ref]
  Date:   Tue Apr 24 22:56:02 2007 +0300
  
      fast-import: size_t vs ssize_t
      
      size_t is unsigned, so (n < 0) is never true.
      
      Signed-off-by: Shawn O. Pearce [off-list ref]

was applied by me to fix this very bug and I also applied the
patch that created the buggy copy in pack-write.c.

-- 
Shawn.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help