/* USB::DevHandle#usb_get_string_simple(index, buf) */
static VALUE
rusb_get_string_simple(
VALUE v,
VALUE vindex,
VALUE vbuf)
{
usb_dev_handle *p = get_usb_devhandle(v);
int index = NUM2INT(vindex);
char *buf;
int buflen;
int ret;
StringValue(vbuf);
rb_str_modify(vbuf);
buf = RSTRING_PTR(vbuf);
buflen = RSTRING_LEN(vbuf);
ret = usb_get_string_simple(p, index, buf, buflen);
check_usb_error("usb_get_string_simple", ret);
return INT2NUM(ret);
}