summaryrefslogtreecommitdiff
path: root/stdio-common/xbug.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdio-common/xbug.c')
-rw-r--r--stdio-common/xbug.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/stdio-common/xbug.c b/stdio-common/xbug.c
index 64ba314cbe..06f74aff00 100644
--- a/stdio-common/xbug.c
+++ b/stdio-common/xbug.c
@@ -14,18 +14,16 @@ void ReadFile (Buffer *buffer, FILE *input);
#define INIT_BUFFER_SIZE 10000
-void InitBuffer(b)
- Buffer *b;
+void
+InitBuffer (Buffer *b)
{
b->room = INIT_BUFFER_SIZE;
b->used = 0;
b->buff = (char *)malloc(INIT_BUFFER_SIZE*sizeof(char));
}
-void AppendToBuffer(b, str, len)
- Buffer *b;
- const char *str;
- int len;
+void
+AppendToBuffer (Buffer *b, const char *str, int len)
{
while (b->used + len > b->room) {
b->buff = (char *)realloc(b->buff, 2*b->room*(sizeof(char)));
@@ -35,9 +33,8 @@ void AppendToBuffer(b, str, len)
b->used += len;
}
-void ReadFile(buffer, input)
- Buffer *buffer;
- FILE *input;
+void
+ReadFile (Buffer *buffer, FILE *input)
{
char buf[BUFSIZ + 1];
int bytes;