libnvpair.c: replace strstr() with strchr() for a single character
Since we're looking for a single new-line character in the haystack, it's better (and slightly efficient) to use strchr() instead of strstr(). Signed-off-by: rilysh <nightquick@proton.me>
This commit is contained in:
parent
d9cb42da99
commit
398d9c5822
|
@ -383,7 +383,7 @@ nvlist_prtctl_setfmt(nvlist_prtctl_t pctl, enum nvlist_prtctl_fmt which,
|
|||
pctl->nvprt_btwnarrfmt_nl = 0;
|
||||
} else {
|
||||
pctl->nvprt_btwnarrfmt = fmt;
|
||||
pctl->nvprt_btwnarrfmt_nl = (strstr(fmt, "\n") != NULL);
|
||||
pctl->nvprt_btwnarrfmt_nl = (strchr(fmt, '\n') != NULL);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in New Issue