From 90e352acc85696c437a7ee8057617e8b6f9df668 Mon Sep 17 00:00:00 2001 From: John Carr Date: Sat, 29 Feb 1992 20:19:38 +0000 Subject: [PATCH] Use ANSI stdio features iff ANSI_STDIO defined git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2252 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/ccache/stdio/scc_maybe.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib/krb5/ccache/stdio/scc_maybe.c b/src/lib/krb5/ccache/stdio/scc_maybe.c index c634b9334..b2a6eaadb 100644 --- a/src/lib/krb5/ccache/stdio/scc_maybe.c +++ b/src/lib/krb5/ccache/stdio/scc_maybe.c @@ -98,7 +98,7 @@ krb5_scc_open_file (id, mode) (void) fclose (data->file); data->file = 0; } -#if defined(__STDC__) +#ifdef ANSI_STDIO switch(mode) { case SCC_OPEN_AND_ERASE: open_flag = "wb+"; @@ -129,9 +129,10 @@ krb5_scc_open_file (id, mode) f = fopen (data->filename, open_flag); if (!f) return krb5_scc_interpret (errno); - setbuf (f, data->stdio_buffer); -#if 0 /* alternative, not requiring sizeof stdio_buffer == BUFSIZ */ +#ifdef ANSI_STDIO setvbuf(f, data->stdio_buffer, _IOFBF, sizeof (data->stdio_buffer)); +#else + setbuf (f, data->stdio_buffer); #endif switch (mode) { case SCC_OPEN_RDONLY: @@ -166,7 +167,7 @@ krb5_scc_open_file (id, mode) (void) fclose(f); return KRB5_CCACHE_BADVNO; } - if (scc_fvno != htons(KRB5_SCC_FVNO)) { + if (scc_fvno != (krb5_int16)htons(KRB5_SCC_FVNO)) { (void) krb5_unlock_file(f, data->filename); (void) fclose(f); return KRB5_CCACHE_BADVNO; -- 2.26.2