Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sbin/route Simplify.
details: https://anonhg.NetBSD.org/src/rev/e5425e9157aa
branches: trunk
changeset: 770177:e5425e9157aa
user: joerg <joerg%NetBSD.org@localhost>
date: Fri Oct 07 09:56:15 2011 +0000
description:
Simplify.
diffstat:
sbin/route/route.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diffs (31 lines):
diff -r 43cd550876fd -r e5425e9157aa sbin/route/route.c
--- a/sbin/route/route.c Fri Oct 07 09:35:04 2011 +0000
+++ b/sbin/route/route.c Fri Oct 07 09:56:15 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: route.c,v 1.132 2011/08/29 14:35:03 joerg Exp $ */
+/* $NetBSD: route.c,v 1.133 2011/10/07 09:56:15 joerg Exp $ */
/*
* Copyright (c) 1983, 1989, 1991, 1993
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)route.c 8.6 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: route.c,v 1.132 2011/08/29 14:35:03 joerg Exp $");
+__RCSID("$NetBSD: route.c,v 1.133 2011/10/07 09:56:15 joerg Exp $");
#endif
#endif /* not lint */
@@ -1392,11 +1392,10 @@
int mplssize = 0;
sup retsu = su;
- n = (char*)malloc(strlen(s) + 1);
+ n = strdup(s);
if (n == NULL)
errx(EXIT_FAILURE, "%s: Cannot allocate memory", s);
norig = n;
- strlcpy(n, s, strlen(s) + 1);
for (uint i = 0; i < strlen(n); i++)
if(n[i] == ',')
mplssize++;
Home |
Main Index |
Thread Index |
Old Index