summaryrefslogtreecommitdiffstats
path: root/bin/sh/expand.c
diff options
context:
space:
mode:
authorcracauer <cracauer@FreeBSD.org>1999-12-04 17:12:47 +0000
committercracauer <cracauer@FreeBSD.org>1999-12-04 17:12:47 +0000
commit46e40e0c76b9170a8c1a4d7d1236f62a00b8fc19 (patch)
tree9e0185bda733cba83b9384749064019c68481789 /bin/sh/expand.c
parente6035644113e5e89248f5475a5e85a1466f8449f (diff)
downloadFreeBSD-src-46e40e0c76b9170a8c1a4d7d1236f62a00b8fc19.zip
FreeBSD-src-46e40e0c76b9170a8c1a4d7d1236f62a00b8fc19.tar.gz
Fix "subscript has type `char'" warnings by casting to int, as
discussed on -arch.
Diffstat (limited to 'bin/sh/expand.c')
-rw-r--r--bin/sh/expand.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/sh/expand.c b/bin/sh/expand.c
index c6102aa..5a1b57d 100644
--- a/bin/sh/expand.c
+++ b/bin/sh/expand.c
@@ -315,7 +315,7 @@ done:
goto lose;
*p = c;
while ((c = *home++) != '\0') {
- if (quotes && SQSYNTAX[c] == CCTL)
+ if (quotes && SQSYNTAX[(int)c] == CCTL)
STPUTC(CTLESC, expdest);
STPUTC(c, expdest);
}
@@ -478,7 +478,7 @@ expbackq(cmd, quoted, flag)
}
lastc = *p++;
if (lastc != '\0') {
- if (quotes && syntax[lastc] == CCTL)
+ if (quotes && syntax[(int)lastc] == CCTL)
STPUTC(CTLESC, dest);
STPUTC(lastc, dest);
}
@@ -694,7 +694,8 @@ again: /* jump here after setting a variable with ${var=text} */
}
else {
while (*val) {
- if (quotes && syntax[*val] == CCTL)
+ if (quotes &&
+ syntax[(int)*val] == CCTL)
STPUTC(CTLESC, expdest);
STPUTC(*val++, expdest);
}
@@ -865,7 +866,7 @@ varvalue(name, quoted, allow_split)
if (allow_split) { \
syntax = quoted? DQSYNTAX : BASESYNTAX; \
while (*p) { \
- if (syntax[*p] == CCTL) \
+ if (syntax[(int)*p] == CCTL) \
STPUTC(CTLESC, expdest); \
STPUTC(*p++, expdest); \
} \
OpenPOWER on IntegriCloud