diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2026-02-07 01:10:55 +0100 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2026-02-07 01:10:55 +0100 |
| commit | 9693daaaef1b996d0efc5338cf3707bb6205fee9 (patch) | |
| tree | 90c88c146f0c1b8b0b78102fe2cf3804dec584ae | |
| parent | 79d35b5a0eae5d0784f34a9dcb6774220aedb611 (diff) | |
| download | busybox-w32-9693daaaef1b996d0efc5338cf3707bb6205fee9.tar.gz busybox-w32-9693daaaef1b996d0efc5338cf3707bb6205fee9.tar.bz2 busybox-w32-9693daaaef1b996d0efc5338cf3707bb6205fee9.zip | |
*: use is_prefixed_with() where appropriate
function old new delta
resume_main 560 556 -4
uuidcache_check_device 107 101 -6
ntp_init 1005 997 -8
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-18) Total: -18 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| -rw-r--r-- | klibc-utils/resume.c | 2 | ||||
| -rw-r--r-- | networking/ntpd.c | 2 | ||||
| -rw-r--r-- | shell/ash.c | 2 | ||||
| -rw-r--r-- | util-linux/volume_id/get_devname.c | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/klibc-utils/resume.c b/klibc-utils/resume.c index fde5587e2..179413627 100644 --- a/klibc-utils/resume.c +++ b/klibc-utils/resume.c | |||
| @@ -39,7 +39,7 @@ static dev_t name_to_dev_t(const char *devname) | |||
| 39 | struct stat st; | 39 | struct stat st; |
| 40 | int r; | 40 | int r; |
| 41 | 41 | ||
| 42 | if (strncmp(devname, "/dev/", 5) != 0) { | 42 | if (!is_prefixed_with(devname, "/dev/")) { |
| 43 | char *cptr; | 43 | char *cptr; |
| 44 | 44 | ||
| 45 | cptr = strchr(devname, ':'); | 45 | cptr = strchr(devname, ':'); |
diff --git a/networking/ntpd.c b/networking/ntpd.c index efe9f5326..595000b11 100644 --- a/networking/ntpd.c +++ b/networking/ntpd.c | |||
| @@ -2395,7 +2395,7 @@ static NOINLINE void ntp_init(char **argv) | |||
| 2395 | while (peers) { | 2395 | while (peers) { |
| 2396 | char *peer = llist_pop(&peers); | 2396 | char *peer = llist_pop(&peers); |
| 2397 | key_entry_t *key_entry = NULL; | 2397 | key_entry_t *key_entry = NULL; |
| 2398 | if (strncmp(peer, "keyno:", 6) == 0) { | 2398 | if (is_prefixed_with(peer, "keyno:")) { |
| 2399 | char *end; | 2399 | char *end; |
| 2400 | int key_id; | 2400 | int key_id; |
| 2401 | peer += 6; | 2401 | peer += 6; |
diff --git a/shell/ash.c b/shell/ash.c index 2f30857d7..4f824e1b2 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
| @@ -1149,7 +1149,7 @@ static void dbg_show_dirtymem(const char *msg) | |||
| 1149 | p = buf; | 1149 | p = buf; |
| 1150 | for (;;) { | 1150 | for (;;) { |
| 1151 | char *e = strchrnul(p, '\n'); | 1151 | char *e = strchrnul(p, '\n'); |
| 1152 | if (strncmp(p, "Private_Dirty:", 14) == 0) { | 1152 | if (is_prefixed_with(p, "Private_Dirty:")) { |
| 1153 | p = skip_whitespace(p + 14); | 1153 | p = skip_whitespace(p + 14); |
| 1154 | bb_error_msg("%s:%.*s", msg, (int)(e - p), p); | 1154 | bb_error_msg("%s:%.*s", msg, (int)(e - p), p); |
| 1155 | break; | 1155 | break; |
diff --git a/util-linux/volume_id/get_devname.c b/util-linux/volume_id/get_devname.c index 39155f256..52bb8e03a 100644 --- a/util-linux/volume_id/get_devname.c +++ b/util-linux/volume_id/get_devname.c | |||
| @@ -110,7 +110,7 @@ uuidcache_check_device(struct recursive_state *state UNUSED_PARAM, | |||
| 110 | /* note: this check rejects links to devices, among other nodes */ | 110 | /* note: this check rejects links to devices, among other nodes */ |
| 111 | if (!S_ISBLK(statbuf->st_mode) | 111 | if (!S_ISBLK(statbuf->st_mode) |
| 112 | #if ENABLE_FEATURE_VOLUMEID_UBIFS | 112 | #if ENABLE_FEATURE_VOLUMEID_UBIFS |
| 113 | && !(S_ISCHR(statbuf->st_mode) && strncmp(bb_basename(device), "ubi", 3) == 0) | 113 | && !(S_ISCHR(statbuf->st_mode) && is_prefixed_with(bb_basename(device), "ubi")) |
| 114 | #endif | 114 | #endif |
| 115 | ) | 115 | ) |
| 116 | return TRUE; | 116 | return TRUE; |
