]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/kern/misc.c (grub_vsnprintf_real): Remove needless explicit
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Mon, 21 Oct 2013 12:02:24 +0000 (14:02 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Mon, 21 Oct 2013 12:02:24 +0000 (14:02 +0200)
\0 checking.

Saves 70 bytes on compressed image.

ChangeLog
grub-core/kern/misc.c

index fef02b0cacba2ccc1ed16567f147fcdb3fcda6e1..c9e88edda5318c0fa315148595247ab43b2ceba2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-10-21  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/kern/misc.c (grub_vsnprintf_real): Remove needless explicit
+       \0 checking.
+
+       Saves 70 bytes on compressed image.
+
 2013-10-21  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/kern/misc.c (grub_strtoull): Remove needless *ptr != 0
index be79dfdc497f912a9eb4d1956c40e3a15fee1e4d..aa8a003f14f0889efb9166ea55ab7e096b9c39e5 100644 (file)
@@ -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++;