Fix sign error in position calculation for mem_seek.
authorMarcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>
Sat, 28 Jul 2012 20:06:09 +0000 (22:06 +0200)
committerMarcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>
Sat, 28 Jul 2012 20:06:09 +0000 (22:06 +0200)
* data-mem.c (mem_seek): Fix sign error in position calculation.

src/data-mem.c

index eda695a402279d81928d946013c3814470f3cc6c..512c295e77fd2b6cd4014a0468142c5d51507f1f 100644 (file)
@@ -137,7 +137,7 @@ mem_seek (gpgme_data_t dh, off_t offset, int whence)
          gpg_err_set_errno (EINVAL);
          return -1;
        }
-      dh->data.mem.offset = dh->data.mem.length - offset;
+      dh->data.mem.offset = dh->data.mem.length + offset;
       break;
     default:
       gpg_err_set_errno (EINVAL);