safec  3.2
Safe C Library - ISO TR24731 Bounds Checking Interface
strremovews_s.c File Reference
#include "safe_str_lib.h"
+ Include dependency graph for strremovews_s.c:

Functions

EXPORT errno_t strremovews_s (char *dest, rsize_t dmax)
 Removes beginning and trailing whitespace from the string pointed to by dest by shifting the text left over writting the beginning whitespace (space or tab). More...
 

Function Documentation

◆ strremovews_s()

EXPORT errno_t strremovews_s ( char *  dest,
rsize_t  dmax 
)

Removes beginning and trailing whitespace from the string pointed to by dest by shifting the text left over writting the beginning whitespace (space or tab).

The shifted-trimmed text is null terminated. The text is shifted so the original pointer can continue to be used. This is useful when the memory was malloc'ed and will need to be freed.

Remarks
EXTENSION TO ISO/IEC TR 24731, Programming languages, environments and system software interfaces, Extensions to the C Library, Part I: Bounds-checking interfaces
Parameters
[out]destpointer to string to left justify
[in]dmaxrestricted maximum length of string
Precondition
dest shall not be a null pointer.
dmax shall not be 0
dmax shall not be greater than RSIZE_MAX_STR
dest shall be null terminated
Return values
EOKwhen successful operation
ESNULLPwhen dest is NULL pointer
ESZEROLwhen dmax = 0
ESLEMAXwhen dmax > RSIZE_MAX_STR
ESUNTERMwhen dest was not null terminated
See also
strljustify_s(),