]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
id can be const char
authorosdl.net!shemminger <osdl.net!shemminger>
Tue, 31 Aug 2004 17:45:21 +0000 (17:45 +0000)
committerosdl.net!shemminger <osdl.net!shemminger>
Tue, 31 Aug 2004 17:45:21 +0000 (17:45 +0000)
(Logical change 1.77)

tc/tc.c

diff --git a/tc/tc.c b/tc/tc.c
index abf56f5b8efe56b68c6d38b6b8bdd3d3614baa03..9ede93fcd09a5b61c6c5e34c2e7f679163e69176 100644 (file)
--- a/tc/tc.c
+++ b/tc/tc.c
@@ -40,7 +40,8 @@ static void *BODY;    /* cached handle dlopen(NULL) */
 static struct qdisc_util * qdisc_list;
 static struct filter_util * filter_list;
 
-static int print_noqopt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
+static int print_noqopt(struct qdisc_util *qu, FILE *f, 
+                       struct rtattr *opt)
 {
        if (opt && RTA_PAYLOAD(opt))
                fprintf(f, "[Unknown qdisc, optlen=%u] ", RTA_PAYLOAD(opt));
@@ -119,8 +120,9 @@ reg:
 noexist:
        q = malloc(sizeof(*q));
        if (q) {
+
                memset(q, 0, sizeof(*q));
-               strncpy(q->id, str, 15);
+               q->id = strcpy(malloc(strlen(str)+1), str);
                q->parse_qopt = parse_noqopt;
                q->print_qopt = print_noqopt;
                goto reg;