diff options
author | yasuoka <> | 2019-05-02 08:38:41 +0000 |
---|---|---|
committer | yasuoka <> | 2019-05-02 08:38:41 +0000 |
commit | 1290f53f998d9ec300bcdf5c33e31d6000cf2266 (patch) | |
tree | dada25d6aa109210698ffbbfde4ba9365061659f /src | |
parent | 3d5d777847c4c3150ded4c8ec6e62798a116c542 (diff) | |
download | openbsd-1290f53f998d9ec300bcdf5c33e31d6000cf2266.tar.gz openbsd-1290f53f998d9ec300bcdf5c33e31d6000cf2266.tar.bz2 openbsd-1290f53f998d9ec300bcdf5c33e31d6000cf2266.zip |
Add test fseek(,-1) works properly.
Diffstat (limited to 'src')
-rw-r--r-- | src/regress/lib/libc/open_memstream/open_memstreamtest.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/regress/lib/libc/open_memstream/open_memstreamtest.c b/src/regress/lib/libc/open_memstream/open_memstreamtest.c index 0608bddeba..5366a82ae9 100644 --- a/src/regress/lib/libc/open_memstream/open_memstreamtest.c +++ b/src/regress/lib/libc/open_memstream/open_memstreamtest.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: open_memstreamtest.c,v 1.4 2014/07/20 01:58:37 guenther Exp $ */ | 1 | /* $OpenBSD: open_memstreamtest.c,v 1.5 2019/05/02 08:38:41 yasuoka Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2011 Martin Pieuchot <mpi@openbsd.org> | 4 | * Copyright (c) 2011 Martin Pieuchot <mpi@openbsd.org> |
@@ -164,13 +164,18 @@ main(void) | |||
164 | failures++; | 164 | failures++; |
165 | } | 165 | } |
166 | 166 | ||
167 | if (fseek(fp, -1, SEEK_END) != 0) { | ||
168 | warnx("failed to fseek. (24)"); | ||
169 | failures++; | ||
170 | } | ||
171 | |||
167 | if (fclose(fp) == EOF) { | 172 | if (fclose(fp) == EOF) { |
168 | warnx("fclose failed. (24)"); | 173 | warnx("fclose failed. (25)"); |
169 | failures++; | 174 | failures++; |
170 | } | 175 | } |
171 | 176 | ||
172 | if (size != 12) { | 177 | if (size != 12) { |
173 | warnx("failed, size %zu should be %u. (25)", | 178 | warnx("failed, size %zu should be %u. (26)", |
174 | size, 12); | 179 | size, 12); |
175 | failures++; | 180 | failures++; |
176 | } | 181 | } |