From patchwork Tue Mar 8 21:59:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyle Russell X-Patchwork-Id: 1603189 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20210112 header.b=KJetdQK6; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=Mdlzd0Ak; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2607:f8b0:4864:20::43a; helo=mail-pf1-x43a.google.com; envelope-from=swupdate+bncbdk3lwhx3aebbq5dt6iqmgqexqsruoq@googlegroups.com; receiver=) Received: from mail-pf1-x43a.google.com (mail-pf1-x43a.google.com [IPv6:2607:f8b0:4864:20::43a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KCq470LL5z9sGD for ; Wed, 9 Mar 2022 08:59:34 +1100 (AEDT) Received: by mail-pf1-x43a.google.com with SMTP id t134-20020a62788c000000b004e1367caccasf311036pfc.14 for ; Tue, 08 Mar 2022 13:59:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1646776772; cv=pass; d=google.com; s=arc-20160816; b=HnKHy7kbCdDW8b+lDEd1ZLsMfpVZXqYnV/DcbKkqwkUTMa2ADYzLfzyHE/ohkcfg3/ trWD7PDHcbAddoABegjl9FQZHf/+jo6ST4IkQA1POFWeXHACMf7BrVhR0y28gwTFPwwm M84wSCzTzwX4vrA1wfuWEnEOeX2SbLQf6Yt1eLJxHxfHQLe3/3ZLYc4LQHz5TyP5pvx8 F1LqtJ5C1mEjpbv2Y3htkATjqbSLXosMODgPP+VDPzFt1FLY63FHik4uZ3fdpmh7n/L/ pOYWB7Z3kOZS6J9g244/kU7P9IxwW4hDeKGF3VCqIYnXTU1uiwmXjjvPJtBxw7BmeTCR dlOQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature :dkim-signature; bh=gCW5DfgHCRPJuG5U4ABsLtRUV5Wkm0Vm72svzT0s0io=; b=PZTys5f/WnOd8/YIP75+pefi79y/GYSkhkQONdlJR9o2WSnz72ZE0B4KKClDa/9hW0 aHYygNFd4p9sW2KrMZyuGax8m+bOFqBkzb8d1KmayY3w/Lt++uQq3Y2LZrktefE2mQXr q+SsUKPioZAoAl5p9QFNUqbrxPh1G1rl3DQz7sjFDVNySEEHyVxV2nHXNRBgt3Ps7KDV jp6GdGUlSo5hIOlvTHKB2sXlIxjnEXPME00TVkfWH2nVJDpIeC8PclCJ8fw5WPMS6EPR koyTwxBs2k3xJVM4qDvuvX2E1WwXnMIkB/F/egFM4py9bBcb14NJpi+ilScCZWjHkesI HfVg== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BiZEcjUu; spf=pass (google.com: domain of bkylerussell@gmail.com designates 2607:f8b0:4864:20::934 as permitted sender) smtp.mailfrom=bkylerussell@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=gCW5DfgHCRPJuG5U4ABsLtRUV5Wkm0Vm72svzT0s0io=; b=KJetdQK6bqCGyThuo9fBkCRBPYHvhtV6uFcQw9SDMzUoMocL/pDYEPnKjf1X5s1EwY lbzctDC2VUXUzQL59pywA5+mRs9arkGSk5AIdX41+TiUmnMKZ7B1WkjVeJPXloFDXKn1 J+ia0kzDzwUQYMKS9QJUNnGTenpV6CR2YFG/E3wzWfnTHugmevrhFvc3OYF0p75Ubzzm D34wtB7XWDWqU17xZjlyTxDRsoNhuR8Ghob6HO3WWmLK+5j/huEu7iIqd066WgSDS8dF 0jsVq36EHeZzryhCY0Aen9rCEbg5Ux4Wo+IztgT0eJIGdvL4xxcG+z23nxHLW3Z11jrU cLLw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=gCW5DfgHCRPJuG5U4ABsLtRUV5Wkm0Vm72svzT0s0io=; b=Mdlzd0AkH96pSCbTzuMPmE7K0YIUXaCD1fZtXtKc7G3m0vo8yCiJuJKtvH5IUtEIbL oIHUGdAOwvFiW18zC/Xi34v/lPL80+/1oaDoOgaKmgLWHW3qSmjNe5yB3Sde3iql4a2S XSsCFakQu4VN5B9QjQuMgFPOVsqk8b/MxH3CqQG4PGqUrwu41o0gMD4g32pQNpI7j/H0 2h1TKFCDZdnxhwId0DaFpPfSxDKCcHOGk+osmtiH+Af1chh/O7mO9LKweAUK6XSUnU3y kfOyJ5iPw8V8QJEbRsbK6X7mVeJ+AXVL4lmEttGaUbGoSlmlyfZHwFfXvWQgf4r/o1zt Iotg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=gCW5DfgHCRPJuG5U4ABsLtRUV5Wkm0Vm72svzT0s0io=; b=X16ep3Ivwv0yLPjjy1jzDmWYY29/1AELnW500XUtEOZFTndjPRPBfXw603Xo30iH6p sPvQMkqtfJ8aV8Hv2T3o5JoDkDEw44+QLtxNnBC1D8Z6vGZmX1tf/bQZL/pETgrPby8n I1Aho7+FczfLAz9WvFnfRY6yr0lUPifyogcPdLGkEb2XDV0YyK7krBCAi83KwjKnPG8g 596seep+eaAtBOSO2Na9KobBfaQ2xdAuOtv2Ek42onJA5YdHe39fs6GU+PZ1toK3hC+w 89rSV7ZDhk8Eel0KnaDzpWZJvFywwSf1NMFQf+IUbWOMu9fW+bjgot8t3sLFMR8V7DDY TxFA== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM533f/7uBysQaL3bvCJekPSB6iAJPbELx1cNCNAIQzoYZAf7G9gA2 zGtQjgrKeE2rk2uhxaXWfXo= X-Google-Smtp-Source: ABdhPJw1I5TyBz0iNN8E6WBNF3nrOO3J6O82G4xggnyLbyOlOARX/rC8f3jaZSHo85B9/xIWqCWnSA== X-Received: by 2002:a05:6a00:1954:b0:4e1:f25:ce41 with SMTP id s20-20020a056a00195400b004e10f25ce41mr20466661pfk.44.1646776772310; Tue, 08 Mar 2022 13:59:32 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a17:902:ed4d:b0:151:cea9:660a with SMTP id y13-20020a170902ed4d00b00151cea9660als62644plb.4.gmail; Tue, 08 Mar 2022 13:59:31 -0800 (PST) X-Received: by 2002:a17:902:a40b:b0:151:6aef:e037 with SMTP id p11-20020a170902a40b00b001516aefe037mr19405991plq.142.1646776771461; Tue, 08 Mar 2022 13:59:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646776771; cv=none; d=google.com; s=arc-20160816; b=hk0FSZ81NHHNJ/79+cLLHAsh8hdsZsjVinuifJlLVpd5wOsFTg4pUCLQGi3pVgu8v9 SjR+usZzTGqJsi/OhERLuSiwsl+T/Ltv2BgazcZjmFuqQzZMEwrxEFVvB+yVQlYgJLzG /bB2zuUwEDysTl51cV/iuLgAfVTUrtkDO2CB7eDeE3UGzIo9FG3sjFMeZPvbmwmR1yuN knMAMWBcZVkZpFOKHPTKwtvTCR2gzG/IBguwCYtVbGamNXWOZWaPDIK2YxWXLVmIXP0e WKgbjdy/UPYY8Ep6RDngW3DP2x8G46y8+YVFKTdokCCDUXU+Do7adn9/72oRIPR/0/Rc +4vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=hKo0BEQeu6ZxgnDeuP4eTQuKfMfITJqw26xqXOJJ/Dw=; b=aHNcbYvFV1bkXVlbPhd/mx1c1NR+yyg+MXIGRT/p5bHvMXWIE0MCp4k4MvitCIAy3w P0IiQb+gNKh0Y6TgTB4/o6IuvBVHdzw6cM9U/CWyKkUdtZz8EyNDvCYKKmhsfwctIMry /JxlKagwR2hB/QdwIe3YhLw3jJoBNNsKQsaHk9OtcpAn+Pqcm6aY0paSyZh2parv0aC9 EaJBNkP/VoqLMiDcHEfsXjY0bgWqLLqmIxn0bJgLpDFZRdN/Jmr9Gso+En06seR2lGLL EivLmHmZpl/bQEv0azCkQiYHpzNrSBEecqWoAdflwHveX12TDnbblUBizTP93uyUWAEB mAjQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BiZEcjUu; spf=pass (google.com: domain of bkylerussell@gmail.com designates 2607:f8b0:4864:20::934 as permitted sender) smtp.mailfrom=bkylerussell@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-ua1-x934.google.com (mail-ua1-x934.google.com. [2607:f8b0:4864:20::934]) by gmr-mx.google.com with ESMTPS id t19-20020a656093000000b00363bc052cd4si5359pgu.5.2022.03.08.13.59.31 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Mar 2022 13:59:31 -0800 (PST) Received-SPF: pass (google.com: domain of bkylerussell@gmail.com designates 2607:f8b0:4864:20::934 as permitted sender) client-ip=2607:f8b0:4864:20::934; Received: by mail-ua1-x934.google.com with SMTP id k5so222093uao.2 for ; Tue, 08 Mar 2022 13:59:31 -0800 (PST) X-Received: by 2002:ab0:1667:0:b0:34b:d5b4:3ccb with SMTP id l36-20020ab01667000000b0034bd5b43ccbmr4634151uae.79.1646776770246; Tue, 08 Mar 2022 13:59:30 -0800 (PST) Received: from hercule.lpdev.prtdev.lexmark.com ([2603:9000:6801:587c:dafa:f35d:1277:ff2e]) by smtp.gmail.com with ESMTPSA id d8-20020a67ec08000000b0031bddbd78fasm20737vso.20.2022.03.08.13.59.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 13:59:29 -0800 (PST) From: Kyle Russell To: swupdate@googlegroups.com Cc: Kyle Russell Subject: [swupdate] [PATCH v3] diskpart_handler: support explicitly sized partitions Date: Tue, 8 Mar 2022 16:59:20 -0500 Message-Id: <20220308215920.2270478-1-bkylerussell@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220213200831.804883-1-bkylerussell@gmail.com> References: <20220213200831.804883-1-bkylerussell@gmail.com> MIME-Version: 1.0 X-Original-Sender: bkylerussell@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BiZEcjUu; spf=pass (google.com: domain of bkylerussell@gmail.com designates 2607:f8b0:4864:20::934 as permitted sender) smtp.mailfrom=bkylerussell@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , When passing in a partition size in units of sectors, fdisk expects you to enable explicit sizing on the partition; otherwise, fdisk assumes you want the partition aligned to the nearest grain (typically 1MB), which may corrupt a partition table containing already explicitly sized partitions. This matches the behavior of other libfdisk clients in util-linux (see excerpt from libfdisk's parse_line_nameval() below): libfdisk/src/script.c: if (pow) /* specified as */ num /= dp->cxt->sector_size; else /* specified as number of sectors */ fdisk_partition_size_explicit(pa, 1); To achieve this, we allow ustrtoull() to return a char* to the suffix of the converted string, if one exists. If the suffix points to '\0', then the entire string was a valid integer, and we assume the user provided an explicit partition size. Otherwise, the default behavior occurs and fdisk aligns the partition to the nearest grain. Signed-off-by: Kyle Russell --- core/util.c | 28 ++++++++++++++++++---------- corelib/lua_interface.c | 2 +- handlers/delta_handler.c | 2 +- handlers/diskpart_handler.c | 19 +++++++++++++------ include/util.h | 2 +- parser/parse_external.c | 2 +- parser/parser.c | 2 +- suricatta/common.c | 2 +- suricatta/server_general.c | 2 +- suricatta/server_hawkbit.c | 2 +- 10 files changed, 39 insertions(+), 24 deletions(-) diff --git a/core/util.c b/core/util.c index 4c8c034..7525521 100644 --- a/core/util.c +++ b/core/util.c @@ -743,7 +743,15 @@ void free_string_array(char **nodes) free(nodes); } -unsigned long long ustrtoull(const char *cp, unsigned int base) +/* + * Like strtoull(), but automatically scales the conversion + * result by size-type units, and only returns a pointer to + * the size unit in the string if requested by the caller. + * + * Sets errno to ERANGE if strtoull() found no digits or + * encountered an overflow, and returns 0 in both cases. + */ +unsigned long long ustrtoull(const char *cp, char **endptr, unsigned int base) { errno = 0; char *endp = NULL; @@ -756,7 +764,8 @@ unsigned long long ustrtoull(const char *cp, unsigned int base) if (cp == endp || (result == ULLONG_MAX && errno == ERANGE)) { errno = ERANGE; - return 0; + result = 0; + goto out; } switch (*endp) { @@ -769,13 +778,12 @@ unsigned long long ustrtoull(const char *cp, unsigned int base) case 'K': case 'k': result *= 1024; - if (endp[1] == 'i') { - if (endp[2] == 'B') - endp += 3; - else - endp += 2; - } } + +out: + if (endptr) + *endptr = endp; + return result; } @@ -1196,7 +1204,7 @@ long long get_output_size(struct img_type *img, bool strict) return -ENOENT; } - bytes = ustrtoull(output_size_str, 0); + bytes = ustrtoull(output_size_str, NULL, 0); if (errno || bytes <= 0) { ERROR("decompressed-size argument %s: ustrtoull failed", output_size_str); @@ -1214,7 +1222,7 @@ long long get_output_size(struct img_type *img, bool strict) return -ENOENT; } - bytes = ustrtoull(output_size_str, 0); + bytes = ustrtoull(output_size_str, NULL, 0); if (errno || bytes <= 0) { ERROR("decrypted-size argument %s: ustrtoull failed", output_size_str); diff --git a/corelib/lua_interface.c b/corelib/lua_interface.c index c15592f..52b6605 100644 --- a/corelib/lua_interface.c +++ b/corelib/lua_interface.c @@ -319,7 +319,7 @@ static void lua_string_to_img(struct img_type *img, const char *key, strncpy(seek_str, value, sizeof(seek_str)); /* convert the offset handling multiplicative suffixes */ - img->seek = ustrtoull(seek_str, 0); + img->seek = ustrtoull(seek_str, NULL, 0); if (errno){ ERROR("offset argument: ustrtoull failed"); } diff --git a/handlers/delta_handler.c b/handlers/delta_handler.c index 3132f2e..f8d330c 100644 --- a/handlers/delta_handler.c +++ b/handlers/delta_handler.c @@ -329,7 +329,7 @@ static int delta_retrieve_attributes(struct img_type *img, struct hnd_priv *priv if (!strcmp(srcsize, "detect")) priv->detectsrcsize = true; else - priv->srcsize = ustrtoull(srcsize, 10); + priv->srcsize = ustrtoull(srcsize, NULL, 10); } char *zckloglevel = dict_get_value(&img->properties, "zckloglevel"); diff --git a/handlers/diskpart_handler.c b/handlers/diskpart_handler.c index fc9b169..d584bda 100644 --- a/handlers/diskpart_handler.c +++ b/handlers/diskpart_handler.c @@ -74,6 +74,7 @@ struct partition_data { char fstype[SWUPDATE_GENERAL_STRING_SIZE]; char dostype[SWUPDATE_GENERAL_STRING_SIZE]; char partuuid[UUID_STR_LEN]; + int explicit_size; LIST_ENTRY(partition_data) next; }; LIST_HEAD(listparts, partition_data); @@ -305,10 +306,13 @@ static int diskpart_set_partition(struct fdisk_partition *pa, ret |= -EINVAL; if (strlen(part->name)) ret |= fdisk_partition_set_name(pa, part->name); - if (part->size != LIBFDISK_INIT_UNDEF(part->size)) + if (part->size != LIBFDISK_INIT_UNDEF(part->size)) { ret |= fdisk_partition_set_size(pa, part->size / sector_size); - else + if (part->explicit_size) + ret |= fdisk_partition_size_explicit(pa, part->explicit_size); + } else { ret |= fdisk_partition_end_follow_default(pa, 1); + } if (parttype) ret |= fdisk_partition_set_type(pa, parttype); @@ -543,7 +547,7 @@ static int diskpart_fill_table(struct fdisk_context *cxt, struct diskpart_table parttype = fdisk_label_get_parttype_from_string(lb, GPT_DEFAULT_ENTRY_TYPE); } } else { - parttype = fdisk_label_get_parttype_from_code(lb, ustrtoull(part->type, 16)); + parttype = fdisk_label_get_parttype_from_code(lb, ustrtoull(part->type, NULL, 16)); } ret = diskpart_set_partition(newpa, part, sector_size, parttype, oldtb->parent); if (ret) { @@ -578,7 +582,7 @@ static int diskpart_fill_table(struct fdisk_context *cxt, struct diskpart_table newpa = fdisk_new_partition(); - parttype = fdisk_label_get_parttype_from_code(lb, ustrtoull(part->dostype, 16)); + parttype = fdisk_label_get_parttype_from_code(lb, ustrtoull(part->dostype, NULL, 16)); if (!parttype) { ERROR("I cannot add hybrid partition %zu(%s) invalid dostype: %s", part->partno, part->name, part->dostype); @@ -846,6 +850,7 @@ static int diskpart(struct img_type *img, part->partno = strtoul(entry->key + strlen("partition-"), NULL, 10); while (elem) { char *equal = index(elem->value, '='); + char *suffix = NULL; if (equal) { for (i = 0; i < ARRAY_SIZE(fields); i++) { if (!((equal - elem->value) == strlen(fields[i]) && @@ -854,10 +859,12 @@ static int diskpart(struct img_type *img, equal++; switch (i) { case PART_SIZE: - part->size = ustrtoull(equal, 10); + part->size = ustrtoull(equal, &suffix, 10); + if (*suffix == '\0') + part->explicit_size = 1; break; case PART_START: - part->start = ustrtoull(equal, 10); + part->start = ustrtoull(equal, NULL, 10); break; case PART_TYPE: strncpy(part->type, equal, sizeof(part->type)); diff --git a/include/util.h b/include/util.h index 950046d..3d52a93 100644 --- a/include/util.h +++ b/include/util.h @@ -228,7 +228,7 @@ void set_version_range(const char *minversion, const char *maxversion, const char *current); -unsigned long long ustrtoull(const char *cp, unsigned int base); +unsigned long long ustrtoull(const char *cp, char **endptr, unsigned int base); const char* get_tmpdir(void); const char* get_tmpdirscripts(void); diff --git a/parser/parse_external.c b/parser/parse_external.c index 6240c46..c6ab4fe 100644 --- a/parser/parse_external.c +++ b/parser/parse_external.c @@ -69,7 +69,7 @@ static void sw_append_stream(struct img_type *img, const char *key, strlcpy(seek_str, value, sizeof(seek_str)); /* convert the offset handling multiplicative suffixes */ - img->seek = ustrtoull(seek_str, 0); + img->seek = ustrtoull(seek_str, NULL, 0); if (errno){ ERROR("offset argument: ustrtoull failed"); } diff --git a/parser/parser.c b/parser/parser.c index 85241f4..eebd581 100644 --- a/parser/parser.c +++ b/parser/parser.c @@ -406,7 +406,7 @@ static int parse_common_attributes(parsertype p, void *elem, struct img_type *im get_hash_value(p, elem, image->sha256); /* convert the offset handling multiplicative suffixes */ - image->seek = ustrtoull(seek_str, 0); + image->seek = ustrtoull(seek_str, NULL, 0); if (errno){ ERROR("offset argument: ustrtoull failed"); return -1; diff --git a/suricatta/common.c b/suricatta/common.c index 28c5e94..c47fa5c 100644 --- a/suricatta/common.c +++ b/suricatta/common.c @@ -25,7 +25,7 @@ void suricatta_channel_settings(void *elem, channel_data_t *chan) GET_FIELD_STRING_RESET(LIBCFG_PARSER, elem, "max-download-speed", tmp); if (strlen(tmp)) - chan->max_download_speed = (unsigned int)ustrtoull(tmp, 10); + chan->max_download_speed = (unsigned int)ustrtoull(tmp, NULL, 10); GET_FIELD_STRING_RESET(LIBCFG_PARSER, elem, "retrywait", tmp); if (strlen(tmp)) diff --git a/suricatta/server_general.c b/suricatta/server_general.c index e674441..47f9078 100644 --- a/suricatta/server_general.c +++ b/suricatta/server_general.c @@ -669,7 +669,7 @@ server_op_res_t server_start(char *fname, int argc, char *argv[]) break; case 'n': channel_data_defaults.max_download_speed = - (unsigned int)ustrtoull(optarg, 10); + (unsigned int)ustrtoull(optarg, NULL, 10); break; case '?': diff --git a/suricatta/server_hawkbit.c b/suricatta/server_hawkbit.c index 68ce32e..5a456e1 100644 --- a/suricatta/server_hawkbit.c +++ b/suricatta/server_hawkbit.c @@ -1848,7 +1848,7 @@ server_op_res_t server_start(char *fname, int argc, char *argv[]) break; case 'n': channel_data_defaults.max_download_speed = - (unsigned int)ustrtoull(optarg, 10); + (unsigned int)ustrtoull(optarg, NULL, 10); break; /* Ignore not recognized options, they can be already parsed by the caller */ case '?':