diff options
author | bojan <bojan@13f79535-47bb-0310-9956-ffa450edef68> | 2008-04-25 22:30:33 +0000 |
---|---|---|
committer | bojan <bojan@13f79535-47bb-0310-9956-ffa450edef68> | 2008-04-25 22:30:33 +0000 |
commit | 922aebfb8fc33176dffbb2dd29cbe8f9308486fb (patch) | |
tree | 23e1ae4873238efb760eb71c43f4ad68101ea4d8 /file_io | |
parent | fe04727b4929278daa55edcb322b71348cda51c7 (diff) | |
download | libapr-922aebfb8fc33176dffbb2dd29cbe8f9308486fb.tar.gz |
Rework possibly non-portable constant expression
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@651721 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io')
-rw-r--r-- | file_io/unix/copy.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/file_io/unix/copy.c b/file_io/unix/copy.c index c0d8021eb..3a1c59a62 100644 --- a/file_io/unix/copy.c +++ b/file_io/unix/copy.c @@ -52,10 +52,15 @@ static apr_status_t apr_file_transfer_contents(const char *from_path, return status; } +#if BUFSIZ > APR_FILE_DEFAULT_BUFSIZE +#define COPY_BUFSIZ BUFSIZ +#else +#define COPY_BUFSIZ APR_FILE_DEFAULT_BUFSIZE +#endif + /* Copy bytes till the cows come home. */ while (1) { - char buf[BUFSIZ > APR_FILE_DEFAULT_BUFSIZE ? BUFSIZ - : APR_FILE_DEFAULT_BUFSIZE]; + char buf[COPY_BUFSIZ]; apr_size_t bytes_this_time = sizeof(buf); apr_status_t read_err; apr_status_t write_err; |