strncpy(s->drive_serial_str, drive_get_serial(s->bdrv),
sizeof(s->drive_serial_str));
if (strlen(s->drive_serial_str) == 0)
- strcpy(s->drive_serial_str, "0");
+ pstrcpy(s->drive_serial_str, sizeof(s->drive_serial_str), "0");
d = (SCSIDevice *)qemu_mallocz(sizeof(SCSIDevice));
d->state = s;
d->destroy = scsi_destroy;
if (is_listen) {
chr->filename = qemu_malloc(256);
if (is_unix) {
- strcpy(chr->filename, "unix:");
+ pstrcpy(chr->filename, 256, "unix:");
} else if (is_telnet) {
- strcpy(chr->filename, "telnet:");
+ pstrcpy(chr->filename, 256, "telnet:");
} else {
- strcpy(chr->filename, "tcp:");
+ pstrcpy(chr->filename, 256, "tcp:");
}
offset = strlen(chr->filename);
}
#define RS2_G0 RS2 (~0)
static const struct sparc_opcode sparc_opcodes[];
-static const int sparc_num_opcodes;
static const char *sparc_decode_asi_v8 (int);
static const char *sparc_decode_asi_v9 (int);
req.ucr_flags = USBD_SHORT_XFER_OK;
ret = ioctl(s->devfd, USB_SET_TIMEOUT, &timeout);
-#if (__NetBSD__ || __OpenBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
if (ret < 0 && errno != EINVAL) {
#else
if (ret < 0) {
"host:%s", devname);
pstrcpy(dev->devpath, sizeof(dev->devpath), "/dev/");
- strcat(dev->devpath, dev_info.udi_devnames[0]);
+ pstrcat(dev->devpath, sizeof(dev->devpath), dev_info.udi_devnames[0]);
/* Mark the endpoints as not yet open */
for (i = 0; i < USB_MAX_ENDPOINTS; i++)
return p->class_name;
}
-void usb_info_device(int bus_num, int addr, int class_id,
- int vendor_id, int product_id,
- const char *product_name,
- int speed)
+static void usb_info_device(int bus_num, int addr, int class_id,
+ int vendor_id, int product_id,
+ const char *product_name,
+ int speed)
{
const char *class_str, *speed_str;