unsigned short int len;
if (fread(&len, sizeof(unsigned short int), 1, queue_file) == 1) {
- char devpath[len];
+ char *devpath = alloca(len);
/* use fread to skip, fseek might drop buffered data */
if (fread(devpath, 1, len, queue_file) == len)
/* if devpath was too long, skip unread characters */
if (read_bytes != len) {
unsigned short int skip_bytes = len - read_bytes;
- char buf[skip_bytes];
+ char *buf = alloca(skip_bytes);
if (fread(buf, 1, skip_bytes, queue_file) != skip_bytes)
return -1;