CLI  2.9
utils.h File Reference

Useful routines. More...

#include <stddef.h>
#include "cli/namespace.h"

Go to the source code of this file.

Functions

void CheckSnprintfResult (char *const STR_Buffer, const size_t UI_BufferLength, const int I_SnprintfResult)
 Control snprintf result. More...
 

Detailed Description

Useful routines.

Author
Alexis Royer

Definition in file utils.h.

Function Documentation

◆ CheckSnprintfResult()

void CheckSnprintfResult ( char *const  STR_Buffer,
const size_t  UI_BufferLength,
const int  I_SnprintfResult 
)

Control snprintf result.

Check whether all characters have been correctly written in the buffer. When an error has occurred, ensures the reset of the buffer. If all characters could not be written, ensures the buffer is terminated by the "...\0" pattern.

Parameters
STR_BufferBuffer where snprintf was asked to print characters.
UI_BufferLengthSize of the buffer.
I_SnprintfResultSprintf result.