Merge "Fix format-overflow warning in mtcInvApi"

This commit is contained in:
Zuul 2019-09-23 16:14:14 +00:00 committed by Gerrit Code Review
commit 2be238d59f
2 changed files with 3 additions and 3 deletions

View File

@ -60,7 +60,7 @@
* number of inventory elements. * number of inventory elements.
* *
*/ */
int mtcInvApi_read_inventory ( int batch ) int mtcInvApi_read_inventory ( uint batch )
{ {
char batch_str [10] ; char batch_str [10] ;
int rc = PASS ; int rc = PASS ;
@ -86,7 +86,7 @@ int mtcInvApi_read_inventory ( int batch )
batch = MTC_INV_BATCH_MAX ; batch = MTC_INV_BATCH_MAX ;
/* Add the batch integer to the request label */ /* Add the batch integer to the request label */
sprintf (&batch_str[0], "%d", batch ); snprintf (&batch_str[0], sizeof(batch_str), "%d", batch );
obj_ptr->sysinvEvent.token.url = MTC_INV_LABEL ; obj_ptr->sysinvEvent.token.url = MTC_INV_LABEL ;
obj_ptr->sysinvEvent.token.url.append(MTC_INV_BATCH); obj_ptr->sysinvEvent.token.url.append(MTC_INV_BATCH);

View File

@ -85,7 +85,7 @@ int mtcInvApi_handler ( libEvent & event );
*- HTTP status codes - any standard HTTP codes *- HTTP status codes - any standard HTTP codes
* *
*****************************************************************************/ *****************************************************************************/
int mtcInvApi_read_inventory ( int batch ); int mtcInvApi_read_inventory ( uint batch );
/** Add a host to the sysinv database /** Add a host to the sysinv database
* *