@@ -356,9 +356,10 @@ static napi_value njsDbObject_getKeys(napi_env env, napi_callback_info info)
356
356
static bool njsDbObject_getKeysHelper (napi_env env , napi_callback_info info ,
357
357
napi_value * returnValue )
358
358
{
359
- int32_t arrayPos , index , exists , size ;
360
359
njsDbObjectType * objType = NULL ;
360
+ int32_t index , exists , size ;
361
361
napi_value arr , temp ;
362
+ uint32_t arrayPos ;
362
363
njsDbObject * obj ;
363
364
364
365
// get object instance from caller
@@ -368,7 +369,8 @@ static bool njsDbObject_getKeysHelper(napi_env env, napi_callback_info info,
368
369
// determine the size of the collection and create an array of that length
369
370
if (dpiObject_getSize (obj -> handle , & size ) < 0 )
370
371
return njsUtils_throwErrorDPI (env , obj -> type -> oracleDb );
371
- NJS_CHECK_NAPI (env , napi_create_array_with_length (env , size , & arr ))
372
+ NJS_CHECK_NAPI (env , napi_create_array_with_length (env , (size_t ) size ,
373
+ & arr ))
372
374
373
375
// iterate over the elements in the collection
374
376
arrayPos = 0 ;
@@ -570,9 +572,10 @@ static napi_value njsDbObject_getValues(napi_env env, napi_callback_info info)
570
572
static bool njsDbObject_getValuesHelper (napi_env env , napi_callback_info info ,
571
573
napi_value * returnValue )
572
574
{
573
- int32_t arrayPos , index , exists , size ;
574
575
njsDbObjectType * objType = NULL ;
576
+ int32_t index , exists , size ;
575
577
napi_value arr , temp ;
578
+ uint32_t arrayPos ;
576
579
njsDbObject * obj ;
577
580
dpiData data ;
578
581
@@ -583,7 +586,8 @@ static bool njsDbObject_getValuesHelper(napi_env env, napi_callback_info info,
583
586
// determine the size of the collection and create an array of that length
584
587
if (dpiObject_getSize (obj -> handle , & size ) < 0 )
585
588
return njsUtils_throwErrorDPI (env , obj -> type -> oracleDb );
586
- NJS_CHECK_NAPI (env , napi_create_array_with_length (env , size , & arr ))
589
+ NJS_CHECK_NAPI (env , napi_create_array_with_length (env , (size_t ) size ,
590
+ & arr ))
587
591
588
592
// iterate over the elements in the collection
589
593
arrayPos = 0 ;
@@ -1254,8 +1258,9 @@ static bool njsDbObjectType_populate(njsDbObjectType *objType,
1254
1258
objType -> fqn = malloc (objType -> fqnLength + 1 );
1255
1259
if (!objType -> fqn )
1256
1260
return njsBaton_setError (baton , errInsufficientMemory );
1257
- sprintf (objType -> fqn , "%.*s.%.*s" , (int ) info -> schemaLength , info -> schema ,
1258
- (int ) info -> nameLength , info -> name );
1261
+ (void ) snprintf (objType -> fqn , objType -> fqnLength + 1 , "%.*s.%.*s" ,
1262
+ (int ) info -> schemaLength , info -> schema , (int ) info -> nameLength ,
1263
+ info -> name );
1259
1264
1260
1265
// set whether or not the class is a collection or not
1261
1266
NJS_CHECK_NAPI (env , napi_get_boolean (env , info -> isCollection , & temp ))
0 commit comments