mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-24 05:25:18 +00:00
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.
This commit is contained in:
parent
83af050800
commit
8fd7eee90e
@ -255,6 +255,10 @@ sexpr2string(const struct sexpr * sexpr, char *buffer, size_t n_buffer)
|
|||||||
ret += tmp;
|
ret += tmp;
|
||||||
break;
|
break;
|
||||||
case SEXPR_NIL:
|
case SEXPR_NIL:
|
||||||
|
tmp = snprintf(buffer + ret, n_buffer - ret, "()");
|
||||||
|
if (tmp == 0)
|
||||||
|
goto error;
|
||||||
|
ret += tmp;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
goto error;
|
goto error;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user