Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH 0/1] Replace strncpy w/ memcpy to avoid -Wstringop-truncation
- X-seq: zsh-workers 44164
- From: Wesley Schwengle <wesleyschwengle@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH 0/1] Replace strncpy w/ memcpy to avoid -Wstringop-truncation
- Date: Sat, 23 Mar 2019 11:43:32 +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:mime-version :content-transfer-encoding; bh=wJHJQM1bRgtpnm3LSqy4yTKMrZeofNNtLbVsumozL44=; b=WPNTXzKby6ChhcAQxIzorBjcN4Few6qONztV4ajNgHr/9/cXPYPS1r+P+zEmCAdmqE Zq1gtqYJc8tpCE+Zww2OkGBf2s13o7+B3EekcLQobuqxEkipJIHTeolWLrmhEFvcoacq YjCn7f3vBGyhGdojiCoK/6f68FWMrVl9PBmpNeE8hmhs6t613a9+HNw8YvyxEGhCVO4T QUy5b2W72EcSUDhu/mFeIptavvUVWwKQoRD5gB8leNKN+Ynmh+DSkk+jh5yNrbXSPEiv Pelm85VaYJIP5mQ5H2aWS7Ruk7oElDroldwfwmerOerHAaLhUJGyj0dUn7XrIwod880r gHJw==
- 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
From: Wesley Schwengle <wesley@xxxxxxxxxxxxx>
Another warning that I saw when building from git on Debian with cc
8.3.0 was this one.
params.c: In function ‘assignstrvalue.part.16’:
params.c:2588:17: warning: ‘strncpy’ output truncated before terminating
nul copying as many bytes from a string as its length [-Wstringop-truncation]
strncpy(z + v->start, val, vlen);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
params.c:2571:20: note: length computed here
vlen = strlen(val);
^~~~~~~~~~~
In this case I replaces strncpy with memcpy().
Wesley Schwengle (1):
Replace strncpy w/ memcpy to avoid -Wstringop-truncation
Src/params.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--
2.21.0.196.g041f5ea1cf
Messages sorted by:
Reverse Date,
Date,
Thread,
Author