From 1188b24a314bd662f9b34ccdeafc303a147354f4 Mon Sep 17 00:00:00 2001 From: "S.J.R. van Schaik" Date: Fri, 17 Mar 2017 13:37:30 +0000 Subject: [PATCH] shell: use min() macro --- source/shell/flash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/shell/flash.c b/source/shell/flash.c index 7bd992e..36abf14 100644 --- a/source/shell/flash.c +++ b/source/shell/flash.c @@ -157,7 +157,7 @@ static void do_flash_write(const char *s) return; while (len) { - nbytes = (len > 256) ? 256 : len; + nbytes = min(len, 256); parse_hex(stdin, buf, nbytes); printf("\n"); print_hex_ascii(buf, nbytes);