libcs compiles with -ansi option now

FossilOrigin-Name: afeca48ac2e33dace533047329ea48224ee5e4bfd4e83449f335d0a022a67215
This commit is contained in:
7u83@mail.ru
2018-03-02 12:36:03 +00:00
parent 8f12f61dbd
commit 14de235c5c
22 changed files with 980 additions and 760 deletions

View File

@ -110,4 +110,28 @@ int format_scan_hex_bytes(uint8_t *dst,const char *s, int len)
return err;
}
char *format_s_hex_bytes(char *dst, const char *format, const char *delim,
const uint8_t * src, int len)
{
format_hex_bytes(dst, format, delim, src, len);
return dst;
}
int format_hdr_flags(char *dst, uint8_t * th)
{
char *s = dst;
s += sprintf(s, "%s", "(");
s += sprintf(s, "%s", cw_get_hdr_flag_t(th) ? "T" : "");
s += sprintf(s, "%s", cw_get_hdr_flag_f(th) ? "F" : "");
s += sprintf(s, "%s", cw_get_hdr_flag_l(th) ? "L" : "");
s += sprintf(s, "%s", cw_get_hdr_flag_w(th) ? "W" : "");
s += sprintf(s, "%s", cw_get_hdr_flag_m(th) ? "M" : "");
s += sprintf(s, "%s", cw_get_hdr_flag_k(th) ? "K" : "");
s += sprintf(s, "%s", ")");
return s - dst;
}