Loading...
Searching...
No Matches
cstring_fit.c File Reference

Copying text into a fixed buffer, and checking what a buffer holds before it is used. More...

#include "text/cstring_fit.h"

Functions

void copy_bounded (char *dst, uint8_t cap, const uint8_t *src, uint8_t len)
 Copy bytes into a fixed buffer, taking what fits and terminating it.
bool cstring_is_clean (const char *s, uint16_t size)
 Whether a byte range holds a string worth keeping.
bool cstring_setting_is_clean (const char *s, uint16_t size, const char *default_str)
 Whether a saved text setting reads as one, where an empty setting can be the real value.

Detailed Description

Copying text into a fixed buffer, and checking what a buffer holds before it is used.