From f8401f760c0c5e7b10bdfbd5fc7357afdaea2744 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Mon, 21 Oct 2013 14:02:24 +0200 Subject: [PATCH] * grub-core/kern/misc.c (grub_vsnprintf_real): Remove needless explicit \0 checking. Saves 70 bytes on compressed image. --- ChangeLog | 7 +++++++ grub-core/kern/misc.c | 16 ++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index fef02b0ca..c9e88edda 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2013-10-21 Vladimir Serbinenko + + * grub-core/kern/misc.c (grub_vsnprintf_real): Remove needless explicit + \0 checking. + + Saves 70 bytes on compressed image. + 2013-10-21 Vladimir Serbinenko * grub-core/kern/misc.c (grub_strtoull): Remove needless *ptr != 0 diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c index be79dfdc4..aa8a003f1 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -732,30 +732,30 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, va_list a curn = n++; - if (*fmt && *fmt =='-') + if (*fmt =='-') fmt++; p = fmt; - while (*fmt && grub_isdigit (*fmt)) + while (grub_isdigit (*fmt)) fmt++; - if (*fmt && *fmt == '$') + if (*fmt == '$') { curn = grub_strtoull (p, 0, 10) - 1; fmt++; } - if (*fmt && *fmt =='-') + if (*fmt =='-') fmt++; - while (*fmt && grub_isdigit (*fmt)) + while (grub_isdigit (*fmt)) fmt++; - if (*fmt && *fmt =='.') + if (*fmt =='.') fmt++; - while (*fmt && grub_isdigit (*fmt)) + while (grub_isdigit (*fmt)) fmt++; c = *fmt++; @@ -841,7 +841,7 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, va_list a rescan:; - if (*fmt && *fmt =='-') + if (*fmt =='-') { rightfill = 1; fmt++;