From 8ea9d9d7e8f38da35d4e8fa756eeb1108adfc00d Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Sun, 18 May 1997 20:00:31 +0000 Subject: [PATCH] moved `alloc_buffer' to common git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1731 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/ftp/ftp/ftp.c | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/appl/ftp/ftp/ftp.c b/appl/ftp/ftp/ftp.c index be699a10e..797fad0f8 100644 --- a/appl/ftp/ftp/ftp.c +++ b/appl/ftp/ftp/ftp.c @@ -544,35 +544,6 @@ abortsend(int sig) #define HASHBYTES 1024 -/* - * Allocate a buffer enough to handle st->st_blksize, if - * there is such a field, otherwise BUFSIZ. - */ - -static void * -alloc_buffer (void *oldbuf, size_t *sz, struct stat *st) -{ - size_t new_sz; - - new_sz = BUFSIZ; -#ifdef HAVE_ST_BLKSIZE - if (st) - new_sz = max(BUFSIZ, st->st_blksize); -#endif - if(new_sz > *sz) { - if (oldbuf) - free (oldbuf); - oldbuf = malloc (new_sz); - if (oldbuf == NULL) { - warn ("malloc"); - *sz = 0; - return NULL; - } - *sz = new_sz; - } - return oldbuf; -} - static int copy_stream(FILE *from, FILE *to) { @@ -1091,7 +1062,8 @@ recvrequest(char *cmd, char *local, char *remote, char *lmode, int printnames) } break2: if (bare_lfs) { - printf("WARNING! %d bare linefeeds received in ASCII mode\n", bare_lfs); + printf("WARNING! %d bare linefeeds received in ASCII mode\n", + bare_lfs); printf("File may not have transferred correctly.\n"); } if (hash) {