felipealmeida pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=8d2c652104d02d5ee4d54b654ce56f8c3cdffb53

commit 8d2c652104d02d5ee4d54b654ce56f8c3cdffb53
Author: Felipe Magno de Almeida <fel...@expertise.dev>
Date:   Mon Dec 14 11:48:29 2020 -0300

    evil: Fix fcntl for F_SETLK and F_SETLKW wrong length calculation
    
    Summary:
    If length and start are both 0, size is wrongfully negative. Besides,
    using length as a delimitator in a range means that [0, length) is a
    half-closed interval, so we don't need to subtract by 1.
    
    Reviewers: vtorri, woohyun, lucas, jptiz
    
    Reviewed By: vtorri, lucas
    
    Subscribers: cedric, #reviewers, #committers
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D12208
---
 src/lib/evil/evil_fcntl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/evil/evil_fcntl.c b/src/lib/evil/evil_fcntl.c
index 14d10b111c..6c556a6cd7 100644
--- a/src/lib/evil/evil_fcntl.c
+++ b/src/lib/evil/evil_fcntl.c
@@ -114,7 +114,7 @@ fcntl(int fd, int cmd, ...)
              if (length != -1L)
                res = 0;
           }
-        fl->l_len = length - fl->l_start - 1;
+        fl->l_len = length - fl->l_start;
 
         pos = _lseek(fd, fl->l_start, fl->l_whence);
         if (pos != -1L)

-- 


Reply via email to