_citrus_NONE_stdenc_cstomb: return E2BIG correctly.

This commit is contained in:
yamt 2003-12-29 17:49:22 +00:00
parent 08f5fb02e9
commit 556685e5a3
1 changed files with 4 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: citrus_none.c,v 1.10 2003/06/26 12:09:56 tshiozak Exp $ */ /* $NetBSD: citrus_none.c,v 1.11 2003/12/29 17:49:22 yamt Exp $ */
/*- /*-
* Copyright (c)2002 Citrus Project, * Copyright (c)2002 Citrus Project,
@ -28,7 +28,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: citrus_none.c,v 1.10 2003/06/26 12:09:56 tshiozak Exp $"); __RCSID("$NetBSD: citrus_none.c,v 1.11 2003/12/29 17:49:22 yamt Exp $");
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <assert.h> #include <assert.h>
@ -407,8 +407,8 @@ _citrus_NONE_stdenc_cstomb(struct _citrus_stdenc * __restrict ce,
return (0); return (0);
} }
if (n<1) { if (n<1) {
*nresult = (size_t)-2; *nresult = (size_t)-1;
return (0); return (E2BIG);
} }
if (csid != 0 || (idx&0xFF) != idx) if (csid != 0 || (idx&0xFF) != idx)
return (EILSEQ); return (EILSEQ);