*: use is_prefixed_with() where appropriate
No binary (build failed)
gcc -Wp,-MD,applets/.usage.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -Iinclude -Iinclude -o applets/usage applets/usage.c
(log yok)
| @@ -39,7 +39,7 @@ static dev_t name_to_dev_t(const char *devname) | |
| struct stat st; | |
| int r; | |
| - | if (strncmp(devname, "/dev/", 5) != 0) { |
| + | if (!is_prefixed_with(devname, "/dev/")) { |
| char *cptr; | |
| cptr = strchr(devname, ':'); | |
| @@ -2395,7 +2395,7 @@ static NOINLINE void ntp_init(char **argv) | |
| while (peers) { | |
| char *peer = llist_pop(&peers); | |
| key_entry_t *key_entry = NULL; | |
| - | if (strncmp(peer, "keyno:", 6) == 0) { |
| + | if (is_prefixed_with(peer, "keyno:")) { |
| char *end; | |
| int key_id; | |
| peer += 6; | |
| @@ -1149,7 +1149,7 @@ static void dbg_show_dirtymem(const char *msg) | |
| p = buf; | |
| for (;;) { | |
| char *e = strchrnul(p, '\n'); | |
| - | if (strncmp(p, "Private_Dirty:", 14) == 0) { |
| + | if (is_prefixed_with(p, "Private_Dirty:")) { |
| p = skip_whitespace(p + 14); | |
| bb_error_msg("%s:%.*s", msg, (int)(e - p), p); | |
| break; | |
| @@ -110,7 +110,7 @@ uuidcache_check_device(struct recursive_state *state UNUSED_PARAM, | |
| /* note: this check rejects links to devices, among other nodes */ | |
| if (!S_ISBLK(statbuf->st_mode) | |
| #if ENABLE_FEATURE_VOLUMEID_UBIFS | |
| - | && !(S_ISCHR(statbuf->st_mode) && strncmp(bb_basename(device), "ubi", 3) == 0) |
| + | && !(S_ISCHR(statbuf->st_mode) && is_prefixed_with(bb_basename(device), "ubi")) |
| #endif | |
| ) | |
| return TRUE; | |