Skip to content

Commit be79b74

Browse files
committed
Replace strnstr with strstr (fix OpenRTX#77)
On Linux, strnstr would come from libbsd, not libc. Using strlen() defeated the purpose and made it slower anyway.
1 parent c42aba0 commit be79b74

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

radio.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,9 @@ void radio_validate_config(const char *filename) {
291291

292292
// First, find out which radio it is.
293293
while (fgets(line, sizeof(line), conf)) {
294-
if (strnstr(line, "Radio:", strlen(line))) {
294+
if (strstr(line, "Radio:")) {
295295
for (i = 0; radio_tab[i].ident; i++) {
296-
if (strnstr(line, radio_tab[i].ident, strlen(line))) goto found;
296+
if (strstr(line, radio_tab[i].ident)) goto found;
297297
}
298298
}
299299
}

0 commit comments

Comments
 (0)