summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libexec/identd/parse.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libexec/identd/parse.c b/libexec/identd/parse.c
index 6947ef830fe..dd4c3e11a8a 100644
--- a/libexec/identd/parse.c
+++ b/libexec/identd/parse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.c,v 1.44 2007/03/21 03:32:28 tedu Exp $ */
+/* $OpenBSD: parse.c,v 1.45 2007/09/26 02:50:36 ray Exp $ */
/*
* This program is in the public domain and may be used freely by anyone
@@ -62,7 +62,7 @@ check_noident(char *homedir)
int
getuserident(char *homedir, char *buf, int len)
{
- char path[MAXPATHLEN], *p;
+ char path[MAXPATHLEN];
int fd, nread, n;
struct stat st;
@@ -87,8 +87,7 @@ getuserident(char *homedir, char *buf, int len)
buf[nread] = '\0';
/* remove illegal characters */
- if ((p = strpbrk(buf, "\r\n")))
- *p = '\0';
+ buf[strcspn(buf, "\r\n")] = '\0';
close(fd);
return 1;