]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
cmd: improve string matching for hex
authorDan Carpenter <dan.carpenter@linaro.org>
Mon, 31 Jul 2023 14:03:59 +0000 (17:03 +0300)
committerTom Rini <trini@konsulko.com>
Tue, 8 Aug 2023 21:41:52 +0000 (17:41 -0400)
Match the "=0x" instead of just "=0".

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Heinrich.Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
cmd/nvedit_efi.c

index 24944ab81e2321c29521f21eb90c177e8c8873b7..7a30b5cc8f87ca4fe614d8cd5227bb11ae9b74ec 100644 (file)
@@ -262,7 +262,7 @@ static int append_value(char **bufp, size_t *sizep, char *data)
        char *tmp_buf = NULL, *new_buf = NULL, *value;
        unsigned long len = 0;
 
-       if (!strncmp(data, "=0x", 2)) { /* hexadecimal number */
+       if (!strncmp(data, "=0x", 3)) { /* hexadecimal number */
                union {
                        u8 u8;
                        u16 u16;