1
0
Fork 0

Merging upstream version 1.14.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-16 11:31:10 +01:00
parent 868b5312e8
commit d6fd2fdea9
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
305 changed files with 20664 additions and 6099 deletions

View file

@ -144,3 +144,18 @@ int wdc_UtilsStrCompare(char *pcSrc, char *pcDst)
return *pcSrc - *pcDst;
}
void wdc_StrFormat(char *formatter, size_t fmt_sz, char *tofmt, size_t tofmtsz)
{
fmt_sz = snprintf(formatter,fmt_sz, "%-*.*s",
(int)tofmtsz, (int)tofmtsz, tofmt);
/* trim() the obnoxious trailing white lines */
while (fmt_sz) {
if (formatter[fmt_sz - 1] != ' ' && formatter[fmt_sz - 1] != '\0') {
formatter[fmt_sz] = '\0';
break;
}
fmt_sz--;
}
}