summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorgerhard <gerhard@openbsd.org>2014-03-06 07:28:21 +0000
committergerhard <gerhard@openbsd.org>2014-03-06 07:28:21 +0000
commitf3c822f9a8fb4085706c9046a5583a5576d138c0 (patch)
treee07714e7dfa08f4abcad76fac51bf3e0c6ceae7c /lib/libc
parentthe pre-5.5 test keys are no longer useful (diff)
downloadwireguard-openbsd-f3c822f9a8fb4085706c9046a5583a5576d138c0.tar.xz
wireguard-openbsd-f3c822f9a8fb4085706c9046a5583a5576d138c0.zip
Fix unsigned comparision.
ok mpi@
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/stdio/open_wmemstream.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/stdio/open_wmemstream.c b/lib/libc/stdio/open_wmemstream.c
index 4ba4cfdc1b5..94141878fdd 100644
--- a/lib/libc/stdio/open_wmemstream.c
+++ b/lib/libc/stdio/open_wmemstream.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: open_wmemstream.c,v 1.2 2013/04/03 03:11:53 guenther Exp $ */
+/* $OpenBSD: open_wmemstream.c,v 1.3 2014/03/06 07:28:21 gerhard Exp $ */
/*
* Copyright (c) 2011 Martin Pieuchot <mpi@openbsd.org>
@@ -62,8 +62,8 @@ wmemstream_write(void *v, const char *b, int l)
nmc = (st->size - st->pos) * sizeof(wchar_t);
len = mbsnrtowcs(st->string + st->pos, &b, nmc, l, &st->mbs);
- if (len < 0)
- return (len);
+ if (len == (size_t)-1)
+ return (-1);
st->pos += len;
if (st->pos > st->len) {