Files
NapCatQQ/.pnpm-store/v3/files/8f/19c2e4a35ae713bd4acefbce522f3c27a3b089c4fe3130e3e2d57b25fa8e112b1353c0ab82e96a82800f47ad04ce39a335edfb0c589406cf8aa1426e275a35
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

22 lines
529 B
Plaintext

#include <ctype.h>
#include <stdio.h>
#include <string.h>
static inline void formatChar(char *str, char ch)
{
// Print some common control codes.
switch (ch) {
case '\r': strcpy(str, "CR "); break;
case '\n': strcpy(str, "LF "); break;
case ' ': strcpy(str, "SP "); break;
case 27: strcpy(str, "^[ "); break;
case 3: strcpy(str, "^C "); break;
default:
if (isgraph(ch))
sprintf(str, "%c ", ch);
else
sprintf(str, "%02x ", ch);
break;
}
}