コード例 #1
0
/*
    Utility function that formats a number as a string

    [ToDo] - Duplicate of a function in FMC_Utils - Consider making an infrastructure utility function
*/
const char *_MCP_BTS_SP_FormatNumber(const char *formatMsg, McpUint number, char *tempStr,McpUint maxTempStrSize)
{
    McpU16 formatMsgLen;
    formatMsgLen=MCP_HAL_STRING_StrLen(formatMsg);

    /*Verfiy that the tempStr allocation is enough  */
    if ((McpU16)(formatMsgLen+MAX_MCP_UINT_SIZE_IN_ASCII)>maxTempStrSize)
        {            
            return invalidMcpempStr;
        }    

    MCP_HAL_STRING_Sprintf(tempStr, formatMsg, number);

    return tempStr;
}
コード例 #2
0
ファイル: fmc_utils.c プロジェクト: anupam19/XperiaL_FM
const char * FMC_UTILS_FormatNumber(const char *formatMsg, FMC_UINT number, char *tempStr,FMC_UINT maxTempStrSize)
{
    FMC_U16 formatMsgLen;
    formatMsgLen=MCP_HAL_STRING_StrLen(formatMsg);

    /*Verify that the tempStr allocation is enough  */
    if ((FMC_U16)(formatMsgLen+MAX_FMC_UINT_SIZE_IN_ASCII)>maxTempStrSize)
        {            
            return invalidFmcTempStr;
        }
    

    MCP_HAL_STRING_Sprintf (tempStr, formatMsg, number);

    return tempStr;
}