1
0
mirror of https://github.com/simh/simh.git synced 2026-01-25 19:56:25 +00:00

Fix compiler identified array bounds issues

This commit is contained in:
Mark Pizzolato
2012-12-21 12:55:57 -08:00
parent d940752232
commit d291a6e838
2 changed files with 3 additions and 2 deletions

View File

@@ -569,7 +569,8 @@ char* eth_getname(int number, char* name)
ETH_LIST list[ETH_MAX_DEVICE];
int count = eth_devices(ETH_MAX_DEVICE, list);
if (count <= number) return NULL;
if ((number < 0) || (count <= number))
return NULL;
strcpy(name, list[number].name);
return name;
}