Space availability check done for 1 byte, too.

git-svn-id: svn://10.0.0.236/trunk@21679 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
cata%netscape.com 1999-02-24 02:18:55 +00:00
parent f5c5ddd71c
commit b2efd04e97
2 changed files with 18 additions and 6 deletions

View File

@ -246,9 +246,15 @@ PRIVATE PRBool uCheckAndGenAlways1Byte(
)
{
/* Don't check inlen. The caller should ensure it is larger than 0 */
*outlen = 1;
out[0] = in & 0xff;
return PR_TRUE;
/* Oops, I don't agree. Code changed to check every time. [CATA] */
if(outbuflen < 1)
return PR_FALSE;
else
{
*outlen = 1;
out[0] = in & 0xff;
return PR_TRUE;
}
}
/*=================================================================================

View File

@ -246,9 +246,15 @@ PRIVATE PRBool uCheckAndGenAlways1Byte(
)
{
/* Don't check inlen. The caller should ensure it is larger than 0 */
*outlen = 1;
out[0] = in & 0xff;
return PR_TRUE;
/* Oops, I don't agree. Code changed to check every time. [CATA] */
if(outbuflen < 1)
return PR_FALSE;
else
{
*outlen = 1;
out[0] = in & 0xff;
return PR_TRUE;
}
}
/*=================================================================================