提交 8fd7eee9 编写于 作者: J Jim Fehlig 提交者: Daniel P. Berrange

Fix sexpr2string() to handle empty list.

S-expression containing empty lists, e.g. (cpus (() () () ())),
was not being handled properly in sexpr2string() serialization.
Emit an empty list when encountering NIL sexpr kind.
上级 83af0508
......@@ -255,6 +255,10 @@ sexpr2string(const struct sexpr * sexpr, char *buffer, size_t n_buffer)
ret += tmp;
break;
case SEXPR_NIL:
tmp = snprintf(buffer + ret, n_buffer - ret, "()");
if (tmp == 0)
goto error;
ret += tmp;
break;
default:
goto error;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册