diff options
Diffstat (limited to 'tor2.c')
-rw-r--r-- | tor2.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -270,10 +270,13 @@ static void init_spans(struct tor2 *tor) int x, y, c; for (x = 0; x < SPANS_PER_CARD; x++) { sprintf(tor->spans[x].name, "Tor2/%d/%d", tor->num, x + 1); - sprintf(tor->spans[x].desc, "Tormenta 2 (PCI) Quad %s Card %d Span %d", (tor->cardtype == TYPE_T1) ? "T1" : "E1", tor->num, x + 1); + snprintf(tor->spans[x].desc, sizeof(tor->spans[x].desc) - 1, + "Tormenta 2 (PCI) fQuad %s Card %d Span %d", + (tor->cardtype == TYPE_T1) ? "T1" : "E1", tor->num, x + 1); tor->spans[x].manufacturer = "Digium"; - tor->spans[x].devicetype = tor->type; - sprintf(tor->spans[x].location, "PCI Bus %02d Slot %02d", tor->pci->bus->number, PCI_SLOT(tor->pci->devfn) + 1); + strncpy(tor->spans[x].devicetype, tor->type, sizeof(tor->spans[x].devicetype) - 1); + snprintf(tor->spans[x].location, sizeof(tor->spans[x].location) - 1, + "PCI Bus %02d Slot %02d", tor->pci->bus->number, PCI_SLOT(tor->pci->devfn) + 1); tor->spans[x].spanconfig = tor2_spanconfig; tor->spans[x].chanconfig = tor2_chanconfig; tor->spans[x].startup = tor2_startup; |