Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/telnet Simplify
details: https://anonhg.NetBSD.org/src/rev/df3dd7131627
branches: trunk
changeset: 770179:df3dd7131627
user: joerg <joerg%NetBSD.org@localhost>
date: Fri Oct 07 10:14:22 2011 +0000
description:
Simplify
diffstat:
usr.bin/telnet/telnet.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diffs (43 lines):
diff -r 3884c68ed2fb -r df3dd7131627 usr.bin/telnet/telnet.c
--- a/usr.bin/telnet/telnet.c Fri Oct 07 10:06:39 2011 +0000
+++ b/usr.bin/telnet/telnet.c Fri Oct 07 10:14:22 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: telnet.c,v 1.32 2011/10/05 10:48:54 roy Exp $ */
+/* $NetBSD: telnet.c,v 1.33 2011/10/07 10:14:22 joerg Exp $ */
/*
* Copyright (c) 1988, 1990, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)telnet.c 8.4 (Berkeley) 5/30/95";
#else
-__RCSID("$NetBSD: telnet.c,v 1.32 2011/10/05 10:48:54 roy Exp $");
+__RCSID("$NetBSD: telnet.c,v 1.33 2011/10/07 10:14:22 joerg Exp $");
#endif
#endif /* not lint */
@@ -753,6 +753,7 @@
{
char zz[1024], *zz_ptr;
char *ext_tc, *newptr;
+ size_t len;
if ((termbuf = (char *) malloc(1024)) == NULL)
goto error;
@@ -763,13 +764,13 @@
if (tgetstr("ZZ", &zz_ptr) != NULL) {
/* it was, fish back the full termcap */
sscanf(zz, "%p", &ext_tc);
- if ((newptr = (char *) realloc(termbuf,
- strlen(ext_tc) + 1))
+ len = strlen(ext_tc) + 1;
+ if ((newptr = (char *) realloc(termbuf, len))
== NULL) {
goto error;
}
- strlcpy(newptr, ext_tc, strlen(ext_tc) + 1);
+ memcpy(newptr, ext_tc, len);
termbuf = newptr;
}
Home |
Main Index |
Thread Index |
Old Index