Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/libexec/talkd backout 1.18 and 1.19
details: https://anonhg.NetBSD.org/src/rev/afc769e462ba
branches: trunk
changeset: 546184:afc769e462ba
user: itojun <itojun%NetBSD.org@localhost>
date: Tue Apr 22 03:51:07 2003 +0000
description:
backout 1.18 and 1.19
diffstat:
libexec/talkd/announce.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diffs (45 lines):
diff -r 05f640518d00 -r afc769e462ba libexec/talkd/announce.c
--- a/libexec/talkd/announce.c Tue Apr 22 03:03:16 2003 +0000
+++ b/libexec/talkd/announce.c Tue Apr 22 03:51:07 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: announce.c,v 1.19 2003/04/22 03:03:16 itojun Exp $ */
+/* $NetBSD: announce.c,v 1.20 2003/04/22 03:51:07 itojun Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)announce.c 8.3 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: announce.c,v 1.19 2003/04/22 03:03:16 itojun Exp $");
+__RCSID("$NetBSD: announce.c,v 1.20 2003/04/22 03:51:07 itojun Exp $");
#endif
#endif /* not lint */
@@ -110,7 +110,7 @@
char line_buf[N_LINES][N_CHARS];
int sizes[N_LINES];
char big_buf[(N_LINES + 1) * N_CHARS];
- char *bptr, *lptr, *vis_user;
+ char *bptr, *lptr, vis_user[sizeof(request->l_name) * 4];
int i, j, max_size;
i = 0;
@@ -129,8 +129,7 @@
sizes[i] = strlen(line_buf[i]);
max_size = max(max_size, sizes[i]);
i++;
- vis_user = malloc(strlen(request->l_name) * 4 + 1);
- if (!vis_user)
+ if (strlen(request->l_name) + 1 > sizeof(vis_user) / 4)
return (FAILED);
strvis(vis_user, request->l_name, VIS_CSTYLE);
(void)snprintf(line_buf[i], N_CHARS,
@@ -140,7 +139,6 @@
i++;
(void)snprintf(line_buf[i], N_CHARS,
"talk: respond with: talk %s@%s", vis_user, remote_machine);
- free(vis_user);
sizes[i] = strlen(line_buf[i]);
max_size = max(max_size, sizes[i]);
i++;
Home |
Main Index |
Thread Index |
Old Index