From c8c4558da540fbba8c39d6550615971ab9476132 Mon Sep 17 00:00:00 2001 From: Khashayar Fereidani Date: Fri, 12 Apr 2024 17:50:49 +0330 Subject: [PATCH] Avoid unnecessary null checks --- safeclib/snprintf_support.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/safeclib/snprintf_support.c b/safeclib/snprintf_support.c index d7a4b67..f7d2002 100644 --- a/safeclib/snprintf_support.c +++ b/safeclib/snprintf_support.c @@ -55,13 +55,13 @@ parse_format(const char *format, char pformatList[], unsigned int maxFormats) break; } // check for and skip the optional field width - while ( format[index] != '\0' && format[index] >= '0' && format[index] <= '9') { + while ( format[index] >= '0' && format[index] <= '9') { index++; } // Check for an skip the optional precision - if ( format[index] != '\0' && format[index] == '.') { + if ( format[index] == '.') { index++; // skip the period - while ( format[index] != '\0' && format[index] >= '0' && format[index] <= '9') { + while ( format[index] >= '0' && format[index] <= '9') { index++; } }