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) {
fmt = strsReplace(&buffs, fmt, sym, "%p");
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) {
res = strsFormat(&buffs, PIKA_SPRINTF_BUFF_SIZE, fmt, "None");
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:
if (NULL != res) {