summaryrefslogtreecommitdiffstats
path: root/bin/ls/util.c
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2002-02-03 19:11:32 +0000
committermarkm <markm@FreeBSD.org>2002-02-03 19:11:32 +0000
commit1084c0a6b26480658bbc0109c5ce24949069a6dc (patch)
tree6da116fe07d933b01529a09b9b07d839dad4b952 /bin/ls/util.c
parent54aef3621773e7a3cca1b434d305b2948d3d87dc (diff)
downloadFreeBSD-src-1084c0a6b26480658bbc0109c5ce24949069a6dc.zip
FreeBSD-src-1084c0a6b26480658bbc0109c5ce24949069a6dc.tar.gz
WARNS=4 fixes, plus a healthy dose of fixes inspired by lint.
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 39ee382..34b5b18 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) {
OpenPOWER on IntegriCloud