Merged in lokeshbv/l-nuttx/libc_stdlib (pull request #440)

libc/stdlib: Error Fix

Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
Lokesh B V 2017-07-21 10:57:20 +00:00 committed by Gregory Nutt
commit 687d966aac

View File

@ -125,7 +125,7 @@ static void incr_base62(void)
{
int i;
for (i = 0; i < MAX_XS; i++)
for (i = MAX_XS - 1; i >= 0; i--)
{
if (g_base62[i] < MAX_LOWERCASE)
{
@ -168,11 +168,8 @@ static void get_base62(FAR uint8_t *ptr)
*
****************************************************************************/
static void copy_base62(FAR char *dest, int len)
static void copy_base62(FAR const uint8_t *src, FAR char *dest, int len)
{
FAR const uint8_t *src;
src = g_base62;
if (len < MAX_XS)
{
src += MAX_XS - len;
@ -268,7 +265,7 @@ int mkstemp(FAR char *path_template)
/* Form the candidate file name */
copy_base62(xptr, xlen);
copy_base62(base62, xptr, xlen);
/* Attempt to open the candidate file -- creating it exclusively
*