Browse Source

Use the volatile specifier to fix warnings about variables being

clobbered by longjmp / vfork instead of the gcc "(void)&foo;" hack.
OPENBSD_3_1
millert 23 years ago
parent
commit
1e2fd73b66
1 changed files with 4 additions and 6 deletions
  1. +4
    -6
      src/lib/libutil/passwd.c

+ 4
- 6
src/lib/libutil/passwd.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: passwd.c,v 1.29 2001/11/14 19:50:23 deraadt Exp $ */
/* $OpenBSD: passwd.c,v 1.30 2002/01/16 01:28:54 millert Exp $ */
/* /*
* Copyright (c) 1987, 1993, 1994, 1995 * Copyright (c) 1987, 1993, 1994, 1995
@ -34,7 +34,7 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char rcsid[] = "$OpenBSD: passwd.c,v 1.29 2001/11/14 19:50:23 deraadt Exp $";
static char rcsid[] = "$OpenBSD: passwd.c,v 1.30 2002/01/16 01:28:54 millert Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <sys/types.h> #include <sys/types.h>
@ -379,12 +379,10 @@ pw_edit(notsetuid, filename)
const char *filename; const char *filename;
{ {
int pstat; int pstat;
char *p, *editor;
char *p;
char * volatile editor;
char *argp[] = {"sh", "-c", NULL, NULL}; char *argp[] = {"sh", "-c", NULL, NULL};
#ifdef __GNUC__
(void)&editor;
#endif
if (!filename) { if (!filename) {
filename = pw_lck; filename = pw_lck;
if (!filename) if (!filename)


Loading…
Cancel
Save