(index, rindex): Obsolete BSDisms; remove. Use standard strchr() and
strrchr() instead. (setbuffer): Obsolete BSDism, unused; remove.
This commit is contained in:
parent
4ae9c417b3
commit
64afd7747b
16 changed files with 29 additions and 227 deletions
|
@ -36,6 +36,7 @@
|
|||
#include "gen.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include "common.h"
|
||||
|
||||
|
@ -67,10 +68,10 @@ kw_read(FILE * fp)
|
|||
/* Allow for comments.. any line starting with # */
|
||||
if (buf[0] == '#')
|
||||
continue;
|
||||
p = rindex(buf, '\n');
|
||||
p = strrchr(buf, '\n');
|
||||
if (p != 0)
|
||||
*p = 0;
|
||||
if ((p = index(buf, ':')) == 0) {
|
||||
if ((p = strchr(buf, ':')) == 0) {
|
||||
logerror("kw_read: Bad keyword line #%d\n", n);
|
||||
return 0;
|
||||
}
|
||||
|
@ -123,7 +124,7 @@ kw_parse(int type, s_char *text, int *data)
|
|||
text = get_time(text, &data[0]);
|
||||
break;
|
||||
case CF_TIMERANGE:
|
||||
if ((next = index(text, '-')) == 0)
|
||||
if ((next = strchr(text, '-')) == 0)
|
||||
return 0;
|
||||
next++;
|
||||
if ((text = get_time(text, &data[0])) == 0)
|
||||
|
|
|
@ -91,11 +91,11 @@ logerror(s_char *format, ...)
|
|||
loginit();
|
||||
va_start(list, format);
|
||||
vsprintf(buf, format, list);
|
||||
if ((p = index(buf, '\n')) != 0)
|
||||
if ((p = strchr(buf, '\n')) != 0)
|
||||
*p = 0;
|
||||
(void)time(&now);
|
||||
strcpy(cbuf, ctime(&now));
|
||||
if ((p = index(cbuf, '\n')) != 0)
|
||||
if ((p = strchr(cbuf, '\n')) != 0)
|
||||
*p = 0;
|
||||
(void)sprintf(buf1, "%s %s\n", cbuf, buf);
|
||||
if ((logf = open(logfile, O_WRONLY | O_CREAT | O_APPEND, 0666)) < 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue