From 3b87dd6f46922cf5f98deb2dffa2148c4244e48e Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 13 Aug 2011 15:00:14 -0700 Subject: [PATCH] ao-tools: ao-list was crashing with more than 3 devices connected the list of devices was getting realloced for each new device, but that realloc was too small. Signed-off-by: Keith Packard --- ao-tools/lib/cc-usbdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ao-tools/lib/cc-usbdev.c b/ao-tools/lib/cc-usbdev.c index afa91d49..a19e231c 100644 --- a/ao-tools/lib/cc-usbdev.c +++ b/ao-tools/lib/cc-usbdev.c @@ -223,7 +223,7 @@ cc_usbdevs_scan(void) if (dev->idVendor == 0xfffe && dev->tty) { if (devs->dev) devs->dev = realloc(devs->dev, - devs->ndev + 1 * sizeof (struct usbdev *)); + (devs->ndev + 1) * sizeof (struct usbdev *)); else devs->dev = malloc (sizeof (struct usbdev *)); devs->dev[devs->ndev++] = dev; -- 2.30.2