summaryrefslogtreecommitdiff
path: root/bin/ls/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/ls/util.c')
-rw-r--r--bin/ls/util.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/bin/ls/util.c b/bin/ls/util.c
index 39ee38281c2b..34b5b186651e 100644
--- a/bin/ls/util.c
+++ b/bin/ls/util.c
@@ -59,7 +59,7 @@ static const char rcsid[] =
int
prn_printable(const char *s)
{
- unsigned char c;
+ char c;
int n;
for (n = 0; (c = *s) != '\0'; ++s, ++n)
@@ -83,13 +83,13 @@ prn_printable(const char *s)
* DES 1998/04/23
*/
-int
+size_t
len_octal(const char *s, int len)
{
- int r = 0;
+ size_t r = 0;
while (len--)
- if (isprint((unsigned char)*s++)) r++; else r += 4;
+ if (isprint((unsigned const char)*s++)) r++; else r += 4;
return r;
}
@@ -99,8 +99,7 @@ prn_octal(const char *s)
unsigned char ch;
int len = 0;
- while ((ch = *s++))
- {
+ while ((ch = (unsigned char)*s++)) {
if (isprint(ch) && (ch != '\"') && (ch != '\\'))
putchar(ch), len++;
else if (f_octal_escape) {