Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Replace strncpy w/ memcpy to avoid -Wstringop-truncation
- X-seq: zsh-workers 44165
- From: Wesley Schwengle <wesleyschwengle@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] Replace strncpy w/ memcpy to avoid -Wstringop-truncation
- Date: Sat, 23 Mar 2019 11:43:33 +0100
- Cc: Wesley Schwengle <wesley@xxxxxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2BlPlO88wGSc16HZxQvEd06wQycX3Q+7IxJ6qiPGBDg=; b=EGvf9IQ/Mlos7/2kK/k6ZAhJX+TwlYhPmhoPPJHgSQXqtlTOqdMWv+Q4zgOsXHBphr XFghCu5wbHrsyOBJzaAhSMeDvCb4jKyf4npnePuQviQR1GJcPVIK6T44oX3z7fqjjCZx nG2M60jK/ZBDylrygGb+fbsIeg1WLmPhwjiCUmtbnsRAKrbck6dkcZilDD9ZRIIfldgu KBlPLcF8f7aA6+AqLAAWRpAK18YYUuJO34c13WPrZ58NHDRodffqmdc6lgiXuYUmko8D JcmEhFU3r2o2c+QiDfyZWCS8dXrvFjPvODWfRex6h/atIzY20rpeKBbQOHdX8mtb3Rso Miog==
- In-reply-to: <20190323104333.22326-1-wesley@mintlab.nl>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20190323104333.22326-1-wesley@mintlab.nl>
From: Wesley Schwengle <wesley@xxxxxxxxxxxxx>
Signed-off-by: Wesley Schwengle <wesley@xxxxxxxxxxxxx>
---
Src/params.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Src/params.c b/Src/params.c
index 089a958ae..66e00e422 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -2585,7 +2585,7 @@ assignstrvalue(Value v, char *val, int flags)
Param pm = v->pm;
/* Size doesn't change, can limit actions to only
* overwriting bytes in already allocated string */
- strncpy(z + v->start, val, vlen);
+ memcpy(z + v->start, val, vlen);
/* Implement remainder of strsetfn */
if (!(pm->node.flags & PM_HASHELEM) &&
((pm->node.flags & PM_NAMEDDIR) ||
--
2.21.0.196.g041f5ea1cf
Messages sorted by:
Reverse Date,
Date,
Thread,
Author