summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-02-26 15:22:38 +0000
committerEric Andersen <andersen@codepoet.org>2002-02-26 15:22:38 +0000
commitefdb21fff439759a746f339e30aba255ed4a60d5 (patch)
tree8f6eeaa5913a9e767c549bf5517e4d75ab4fe644
parent801c69a4187fb34570bc52efc1c1b3957435f7cf (diff)
Be consistant and use an unsigned char * throughout
-rw-r--r--include/stdio.h2
-rw-r--r--libc/stdio/stdio.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/include/stdio.h b/include/stdio.h
index c5b013c08..e418b2f0b 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -60,7 +60,7 @@ struct _UC_FILE {
unsigned char mode;
unsigned char ungot;
- char unbuf[2]; /* The buffer for 'unbuffered' streams */
+ unsigned char unbuf[2]; /* The buffer for 'unbuffered' streams */
};
typedef struct _UC_FILE FILE;
diff --git a/libc/stdio/stdio.c b/libc/stdio/stdio.c
index 6389d9ffc..4a0dc8188 100644
--- a/libc/stdio/stdio.c
+++ b/libc/stdio/stdio.c
@@ -842,8 +842,9 @@ void setbuffer(FILE *fp, char *buf, size_t size)
#endif
#ifdef L_setvbuf
-int setvbuf(FILE *fp, char *buf, int mode, size_t size)
+int setvbuf(FILE *fp, char *ubuf, int mode, size_t size)
{
+ unsigned char *buf = ubuf;
int allocated_buf_flag;
if ((mode < 0) || (mode > 2)) { /* Illegal mode. */
@@ -877,7 +878,7 @@ int setvbuf(FILE *fp, char *buf, int mode, size_t size)
}
}
- if (buf && (buf != (char *) fp->bufstart)) { /* Want different buffer. */
+ if (buf && (buf != fp->bufstart)) { /* Want different buffer. */
_free_stdio_buffer_of_file(fp); /* Free the old buffer. */
fp->mode |= allocated_buf_flag; /* Allocated? or FILE's builtin. */
fp->bufstart = buf;