X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=cmd%2Fmtdparts.c;h=0da3afd75ff03877fa8c5753c6c3887ac0296251;hb=694b05240161eecc9628d5816fbf3d37f3c32e2d;hp=3275eb919bfb2a561364570de2c8a2c6dd0212ea;hpb=6aee2ab68c362ace5a59f89a63abed82e0bf19e5;p=oweals%2Fu-boot.git diff --git a/cmd/mtdparts.c b/cmd/mtdparts.c index 3275eb919b..0da3afd75f 100644 --- a/cmd/mtdparts.c +++ b/cmd/mtdparts.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2002 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. @@ -20,8 +21,6 @@ * * $Id: cmdlinepart.c,v 1.17 2004/11/26 11:18:47 lavinen Exp $ * Copyright 2002 SYSGO Real-Time Solutions GmbH - * - * SPDX-License-Identifier: GPL-2.0+ */ /* @@ -81,7 +80,7 @@ #include #if defined(CONFIG_CMD_NAND) -#include +#include #include #endif @@ -691,7 +690,7 @@ static int part_parse(const char *const partdef, const char **ret, struct part_i part->auto_name = 0; } else { /* auto generated name in form of size@offset */ - sprintf(part->name, "0x%08llx@0x%08llx", size, offset); + snprintf(part->name, name_len, "0x%08llx@0x%08llx", size, offset); part->auto_name = 1; } @@ -873,15 +872,12 @@ static int device_parse(const char *const mtd_dev, const char **ret, struct mtd_ return 1; } -#ifdef DEBUG pend = strchr(p, ';'); -#endif debug("dev type = %d (%s), dev num = %d, mtd-id = %s\n", id->type, MTD_DEV_TYPE(id->type), id->num, id->mtd_id); debug("parsing partitions %.*s\n", (int)(pend ? pend - p : strlen(p)), p); - /* parse partitions */ num_parts = 0;