about summary refs log tree commit diff
path: root/src/stdio/open_memstream.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdio/open_memstream.c')
-rw-r--r--src/stdio/open_memstream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stdio/open_memstream.c b/src/stdio/open_memstream.c
index 2f3569f1..57737098 100644
--- a/src/stdio/open_memstream.c
+++ b/src/stdio/open_memstream.c
@@ -28,7 +28,7 @@ static off_t ms_seek(FILE *f, off_t off, int whence)
 		errno = EINVAL;
 		return -1;
 	}
-	if (-off > base || off > SSIZE_MAX-base) goto fail;
+	if (off < -base || off > SSIZE_MAX-base) goto fail;
 	return c->pos = base+off;
 }