int format_bool(char * res, formatDescr * fmtdscr, int val) { if (fmtdscr->conv=='b'){ if (val){ native_strcpy(res, "true"); return 4; } else { native_strcpy(res, "false"); return 5; } } else if (fmtdscr->conv=='B'){ if (val){ native_strcpy(res, "TRUE"); return 4; } else { native_strcpy(res, "FALSE"); return 5; } } else { return 0; } }
// append a string to another one void native_strcat(char *dst, const char *src) { while(*dst) dst++; // skip string native_strcpy(dst, src); // attach it }