svn commit: trunk/uClibc/libc/misc: syslog ttyent
psm at uclibc.org
psm at uclibc.org
Thu Nov 10 14:43:17 UTC 2005
Author: psm
Date: 2005-11-10 06:43:07 -0800 (Thu, 10 Nov 2005)
New Revision: 12203
Log:
Use strchr instead of index (BSD)
Modified:
trunk/uClibc/libc/misc/syslog/syslog.c
trunk/uClibc/libc/misc/ttyent/getttyent.c
Changeset:
Modified: trunk/uClibc/libc/misc/syslog/syslog.c
===================================================================
--- trunk/uClibc/libc/misc/syslog/syslog.c 2005-11-10 06:26:40 UTC (rev 12202)
+++ trunk/uClibc/libc/misc/syslog/syslog.c 2005-11-10 14:43:07 UTC (rev 12203)
@@ -254,7 +254,7 @@
/* should mode be `O_WRONLY | O_NOCTTY' ? -- Uli */
if (LogStat & LOG_CONS &&
(fd = open(_PATH_CONSOLE, O_WRONLY, 0)) >= 0) {
- p = index(tbuf, '>') + 1;
+ p = strchr(tbuf, '>') + 1;
last_chr[0] = '\r';
last_chr[1] = '\n';
(void)write(fd, p, last_chr - p + 2);
Modified: trunk/uClibc/libc/misc/ttyent/getttyent.c
===================================================================
--- trunk/uClibc/libc/misc/ttyent/getttyent.c 2005-11-10 06:26:40 UTC (rev 12202)
+++ trunk/uClibc/libc/misc/ttyent/getttyent.c 2005-11-10 14:43:07 UTC (rev 12203)
@@ -96,7 +96,7 @@
static char * value(register char *p)
{
- return ((p = index(p, '=')) ? ++p : NULL);
+ return ((p = strchr(p, '=')) ? ++p : NULL);
}
struct ttyent * getttyent(void)
@@ -122,7 +122,7 @@
return (NULL);
}
/* skip lines that are too big */
- if (!index(p, '\n')) {
+ if (!strchr(p, '\n')) {
while ((c = getc_unlocked(tf)) != '\n' && c != EOF)
;
continue;
@@ -171,7 +171,7 @@
tty.ty_comment = p;
if (*p == 0)
tty.ty_comment = 0;
- if ((p = index(p, '\n')))
+ if ((p = strchr(p, '\n')))
*p = '\0';
return (&tty);
}
More information about the uClibc-cvs
mailing list