*ret_fs = 0;
strip_line(line);
- cp = strchr(line, '#');
- if (cp)
- *cp = '\0'; /* Ignore everything after the comment char */
+ *strchrnul(line, '#') = '\0'; /* Ignore everything after comment */
cp = line;
device = parse_word(&cp);
while (reads(fd, buffer, buflen)) {
int l;
- char *p;
- p = strchr(buffer, '#');
- if (p)
- *p = '\0';
+ *strchrnul(buffer, '#') = '\0';
l = strlen(buffer);
static char *nextline(void)
{
- char *cp;
-
if (fgets(line, LINE_SIZE, fconfig) == NULL)
return NULL;
- cp = strchr(line, '\n');
- if (cp)
- *cp = '\0';
+ *strchrnul(line, '\n') = '\0';
return line;
}
while (fgets(buffer, READ_CONFIG_BUF_SIZE, in)) {
char debug_orig[READ_CONFIG_BUF_SIZE];
- char *p;
lm++;
- p = strchr(buffer, '\n');
- if (p) *p = '\0';
- if (ENABLE_FEATURE_UDHCP_DEBUG) strcpy(debug_orig, buffer);
- p = strchr(buffer, '#');
- if (p) *p = '\0';
+ *strchrnul(buffer, '\n') = '\0';
+ if (ENABLE_FEATURE_UDHCP_DEBUG)
+ strcpy(debug_orig, buffer);
+ *strchrnul(buffer, '#') = '\0';
token = strtok(buffer, " \t");
if (!token) continue;
// Might this be a virtual filesystem?
if (ENABLE_FEATURE_MOUNT_HELPERS
- && (strchr(mp->mnt_fsname,'#'))
+ && (strchr(mp->mnt_fsname, '#'))
) {
char *s, *p, *args[35];
int n = 0;