gcc 3.0 warnings

This commit is contained in:
albert
2002-10-12 04:25:57 +00:00
parent f86b39f44e
commit 81a4a3d281
18 changed files with 60 additions and 61 deletions

View File

@ -29,8 +29,8 @@ unsigned print_str(FILE* file, char *s, unsigned max) {
to octal as we go, separating items of the list by 'sep' and stopping after
processing max chars of output (accounting for expansion due to octal rep).
*/
unsigned print_strlist(FILE* file, char **strs, char* sep, unsigned max) {
int i, n, seplen = strlen(sep);
unsigned print_strlist(FILE* file, char **strs, unsigned max) {
int i, n;
for (n=0; *strs && n < max; strs++) {
for (i=0; strs[0][i] && n+i < max; i++)
if (isprint(strs[0][i]) || strs[0][i] == ' ')
@ -43,9 +43,9 @@ unsigned print_strlist(FILE* file, char **strs, char* sep, unsigned max) {
return max - n;
}
n += i;
if (n + seplen < max) {
fputs(sep, file);
n += seplen;
if (n + 1 < max) {
fputc(' ', file);
n++;
} else
return max - n;
}