summaryrefslogtreecommitdiffstats
path: root/tc
diff options
context:
space:
mode:
authorosdl.net!shemminger <osdl.net!shemminger>2004-08-31 17:45:21 +0000
committerosdl.net!shemminger <osdl.net!shemminger>2004-08-31 17:45:21 +0000
commit1798c9d5a421f4c8136c8d887feb5c5b126643b9 (patch)
tree9d104da7bcff5bffe58eb48b5c6d2fec102ef79c /tc
parentde481780a582f2800a6398296f2ca8269a3ddcfb (diff)
id can be const char
(Logical change 1.77)
Diffstat (limited to 'tc')
-rw-r--r--tc/tc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tc/tc.c b/tc/tc.c
index abf56f5b..9ede93fc 100644
--- 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;