1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-11 07:17:58 +00:00

Bugfix: bitforce: Allocate enough space for FTDI description pointers

Con's uglify of the FTDI autodetect replaced a standard C99 array with non-standard alloca that needs the developer to specify the size in bytes rather than elements, but he didn't account for pointer size at all
This commit is contained in:
Luke Dashjr 2012-08-10 22:19:17 +00:00
parent 0adbcd5d07
commit fa3a25f876

View File

@ -175,7 +175,7 @@ static int bitforce_autodetect_ftdi(void)
applog(LOG_DEBUG, "FTDI reports %u devices", (unsigned)numDevs); applog(LOG_DEBUG, "FTDI reports %u devices", (unsigned)numDevs);
buf = alloca(65 * numDevs); buf = alloca(65 * numDevs);
bufptrs = alloca(numDevs + 1); bufptrs = alloca(sizeof(*bufptrs) * (numDevs + 1));
for (i = 0; i < numDevs; ++i) for (i = 0; i < numDevs; ++i)
bufptrs[i] = &buf[i * 65]; bufptrs[i] = &buf[i * 65];