summaryrefslogtreecommitdiff
path: root/chpst.c
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2019-10-12 22:46:42 -0400
committerJoe Crayne <joe@jerkface.net>2019-10-12 22:46:42 -0400
commit1b82bb025ec2db0f1a01b0059358c3c4bef3983e (patch)
tree20a466088e848d330e7e9beb565834be7745caa4 /chpst.c
parent92bd9bda66884dbbb1f572f0cdf0063cea0b7d76 (diff)
Applied debian patch for undefined operation warning.
0016-fix-warning-for-undefined-operation-on-sequence-poin.patch From: Jan <cloux@rote.ch> Date: Sat, 2 Mar 2019 22:56:30 +0100 Subject: fix: warning for undefined operation on sequence point in chpst.c MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit chpst.c:312:33: warning: operation on ‘subgetoptarg’ may be undefined [-Wsequence-point] if (optarg[scan_ulong(++optarg, &ul)]) usage(); see accepted answer on: https://stackoverflow.com/questions/10623114/operation-on-may-be-undefined see also http://c-faq.com/expr/seqpoints.html : "... This rule effectively constrains legal expressions to those in which the accesses demonstrably precede the modification."
Diffstat (limited to 'chpst.c')
-rw-r--r--chpst.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/chpst.c b/chpst.c
index 8de213f..1c3073f 100644
--- a/chpst.c
+++ b/chpst.c
@@ -309,7 +309,8 @@ int main(int argc, char **argv) {
309 case 'n': 309 case 'n':
310 switch (*optarg) { 310 switch (*optarg) {
311 case '-': 311 case '-':
312 if (optarg[scan_ulong(++optarg, &ul)]) usage(); 312 ++optarg;
313 if (optarg[scan_ulong(optarg, &ul)]) usage();
313 nicelvl =ul; 314 nicelvl =ul;
314 nicelvl *=-1; 315 nicelvl *=-1;
315 break; 316 break;