sexp_get_output_bytevector should check for errors from sexp_get_output_string

This commit is contained in:
Alex Shinn 2015-01-22 18:15:11 +09:00
parent 6ef0be789d
commit c2fe35e5d6

View file

@ -291,7 +291,8 @@ sexp sexp_get_output_bytevector (sexp ctx, sexp self, sexp port) {
return sexp_xtype_exception(ctx, self, "not a binary port", port);
sexp_gc_preserve1(ctx, res);
res = sexp_get_output_string(ctx, port);
res = sexp_string_to_bytes(ctx, res);
if (!sexp_exceptionp(res))
res = sexp_string_to_bytes(ctx, res);
sexp_gc_release1(ctx);
return res;
}