Skip to contentSkip to conversation

bpf: Use isdigit() in bpf_bprintf_prepare()

PATCH New Thorsten Blum 1 participant 1 message Nov 21 BPF

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bpf: Use isdigit() in bpf_bprintf_prepare()

Use isdigit() to replace the open-coded implementation.

---
 kernel/bpf/helpers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/bpf/helpers.c +1 -1
index 6788489a2608..7292a15ffbb2 100644
@@ -927,7 +927,7 @@ int bpf_bprintf_prepare(const char *fmt, u32 fmt_size, const u64 *raw_args,
 			i++;
 		if (fmt[i] >= '1' && fmt[i] <= '9') {
 			i++;
-			while (fmt[i] >= '0' && fmt[i] <= '9')
+			while (isdigit(fmt[i]))
 				i++;
 		}