tiencr.c
/*
 * \brief Write out the specified buffer
 *
 * \param file_path Output file
 * \param buffer Pointer to byte buffer to write out
 * \param buf_size Size of buffer
 */
\brief Write out the specified buffer
\param file_path Output file
\param buffer Pointer to byte buffer to write out
\param buf_size Size of buffer
\ brief Write out the specified buffer \ param file_path Output file \ param buffer Pointer to byte buffer to write out \ param buf_size Size of buffer
int write_buffer(const char* file_path, uint8_t* buffer, size_t buf_size)
{
	int ret = 0;
	FILE *fp = NULL;
	fp = fopen(file_path,"wb");
	if( fp == NULL )
	{
		printf("Error opening .encr file\n");
		ret = ERR_FILE_IO;
		goto err;
	}
	fwrite(buffer,1,buf_size,fp);
	fclose(fp);
err:
	fclose(fp);
	return ret;
}
int write_buffer ( const char * file_path , uint8_t * buffer , size_t buf_size ) { int ret = 0 ; FILE * fp = NULL ; fp = fopen ( file_path , " " ) ; if ( fp == NULL ) { printf ( " \n " ) ; ret = ERR_FILE_IO ; goto err ; } fwrite ( buffer , 1 , buf_size , fp ) ; fclose ( fp ) ; err : fclose ( fp ) ; return ret ; }
\brief Write out the specified buffer
 \param file_path Output file
 \param buffer Pointer to byte buffer to write out
 \param buf_size Size of buffer
\ brief Write out the specified buffer \ param file_path Output file \ param buffer Pointer to byte buffer to write out \ param buf_size Size of buffer