Put klen' and
newk' back in local block so that their scope is limited.
(Reduces 1.31 to a one-line diff from 1.30.)
This commit is contained in:
parent
b255c47737
commit
c8e92c46c8
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: main.c,v 1.31 2002/03/04 13:16:03 lukem Exp $ */
|
/* $NetBSD: main.c,v 1.32 2002/03/05 15:37:35 tv Exp $ */
|
||||||
/* $OpenBSD: main.c,v 1.51 2001/10/06 10:52:25 espie Exp $ */
|
/* $OpenBSD: main.c,v 1.51 2001/10/06 10:52:25 espie Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
@ -47,7 +47,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\
|
|||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";
|
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: main.c,v 1.31 2002/03/04 13:16:03 lukem Exp $");
|
__RCSID("$NetBSD: main.c,v 1.32 2002/03/05 15:37:35 tv Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
@ -561,16 +561,17 @@ inspect(c, tp)
|
|||||||
static void
|
static void
|
||||||
initkwds()
|
initkwds()
|
||||||
{
|
{
|
||||||
size_t i, klen;
|
size_t i;
|
||||||
unsigned int h;
|
unsigned int h;
|
||||||
ndptr p;
|
ndptr p;
|
||||||
char *k, *newk;
|
char *k;
|
||||||
|
|
||||||
for (i = 0; i < MAXKEYS; i++) {
|
for (i = 0; i < MAXKEYS; i++) {
|
||||||
k = (char *)keywrds[i].knam;
|
k = (char *)keywrds[i].knam;
|
||||||
if (m4prefix) {
|
if (m4prefix) {
|
||||||
klen = strlen(k) + 4;
|
size_t klen = strlen(k);
|
||||||
newk = malloc(klen);
|
char *newk = malloc(klen + 4);
|
||||||
|
|
||||||
if (snprintf(newk, klen, "m4_%s", k) == -1)
|
if (snprintf(newk, klen, "m4_%s", k) == -1)
|
||||||
err(1, "snprintf");
|
err(1, "snprintf");
|
||||||
keywrds[i].knam = newk;
|
keywrds[i].knam = newk;
|
||||||
|
Loading…
Reference in New Issue
Block a user