fix %r print

This commit is contained in:
lyon 2024-08-11 01:12:45 +08:00
parent ffaa73eff7
commit f85e44a3b3

View File

@ -532,6 +532,8 @@ char* strsFormatArg(Args* out_buffs, char* fmt, Arg* arg) {
if (type == ARG_TYPE_POINTER) { if (type == ARG_TYPE_POINTER) {
fmt = strsReplace(&buffs, fmt, sym, "%p"); fmt = strsReplace(&buffs, fmt, sym, "%p");
break; break;
}else{
fmt = strsReplace(&buffs, fmt, sym, "%s");
} }
} }
} }
@ -553,6 +555,12 @@ char* strsFormatArg(Args* out_buffs, char* fmt, Arg* arg) {
if (ARG_TYPE_NONE == type) { if (ARG_TYPE_NONE == type) {
res = strsFormat(&buffs, PIKA_SPRINTF_BUFF_SIZE, fmt, "None"); res = strsFormat(&buffs, PIKA_SPRINTF_BUFF_SIZE, fmt, "None");
goto __exit; goto __exit;
}else{
Arg* arg_str = arg_toStrArg(arg);
if (NULL != arg_str){
res = strsFormat(&buffs, PIKA_SPRINTF_BUFF_SIZE, fmt, arg_getStr(arg_str));
arg_deinit(arg_str);
}
} }
__exit: __exit:
if (NULL != res) { if (NULL != res) {