summaryrefslogtreecommitdiffhomepage
path: root/include/stc/coption.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-11-22 16:12:35 +0100
committerTyge Løvset <[email protected]>2022-11-22 16:12:35 +0100
commit72f75574edea7a864d5784e38d7d90315c2b2190 (patch)
tree74e5b097b75c8d13faacc781106c4b99a1040169 /include/stc/coption.h
parent512cba08af831a864e09d34f02250820d3d76883 (diff)
downloadSTC-modified-72f75574edea7a864d5784e38d7d90315c2b2190.tar.gz
STC-modified-72f75574edea7a864d5784e38d7d90315c2b2190.zip
Fixes of -Wconversion warnings (not examples).
Diffstat (limited to 'include/stc/coption.h')
-rw-r--r--include/stc/coption.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/stc/coption.h b/include/stc/coption.h
index db715f5c..6b01c5a3 100644
--- a/include/stc/coption.h
+++ b/include/stc/coption.h
@@ -129,7 +129,7 @@ static int coption_get(coption *opt, int argc, char *argv[],
const coption_long *o = 0, *o_exact = 0, *o_partial = 0;
for (j = 2; argv[opt->_i][j] != '\0' && argv[opt->_i][j] != '='; ++j) {} /* find the end of the option name */
for (k = 0; longopts[k].name != 0; ++k)
- if (strncmp(&argv[opt->_i][2], longopts[k].name, j - 2) == 0) {
+ if (strncmp(&argv[opt->_i][2], longopts[k].name, (size_t)(j - 2)) == 0) {
if (longopts[k].name[j - 2] == 0) ++n_exact, o_exact = &longopts[k];
else ++n_partial, o_partial = &longopts[k];
}