summaryrefslogtreecommitdiff
path: root/lib/libc/stdio
diff options
context:
space:
mode:
authortron <tron@NetBSD.org>2010-09-25 14:00:30 +0000
committertron <tron@NetBSD.org>2010-09-25 14:00:30 +0000
commitac440cccfdad847849ccf219a538c8d420e2e88b (patch)
tree711d11f8d43671894aefdddbd32d1131f8065f99 /lib/libc/stdio
parentabf0c843b2978134d0d52d6f5948f38b6dad01d6 (diff)
Change last commit to Use "ptrdiff_t" instead of "intptr_t" because the
former is more appropriate in this case.
Diffstat (limited to 'lib/libc/stdio')
-rw-r--r--lib/libc/stdio/fmemopen.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libc/stdio/fmemopen.c b/lib/libc/stdio/fmemopen.c
index 3e26c6db8a1..1ed07e74976 100644
--- a/lib/libc/stdio/fmemopen.c
+++ b/lib/libc/stdio/fmemopen.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fmemopen.c,v 1.2 2010/09/25 13:45:11 tron Exp $ */
+/* $NetBSD: fmemopen.c,v 1.3 2010/09/25 14:00:30 tron Exp $ */
/*-
* Copyright (c)2007, 2010 Takehiko NOZAKI,
@@ -29,12 +29,13 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fmemopen.c,v 1.2 2010/09/25 13:45:11 tron Exp $");
+__RCSID("$NetBSD: fmemopen.c,v 1.3 2010/09/25 14:00:30 tron Exp $");
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
@@ -116,7 +117,7 @@ fmemopen_seek(void *cookie, fpos_t offset, int whence)
goto error;
}
if (offset >= (fpos_t)0 && offset <= p->tail - p->head) {
- p->cur = p->head + (intptr_t)offset;
+ p->cur = p->head + (ptrdiff_t)offset;
return (fpos_t)(p->cur - p->head);
}
error: