From 43163979c063243c700348d2e711fe56ebdd5a9c Mon Sep 17 00:00:00 2001 From: John Kohl Date: Fri, 19 Apr 1991 14:54:05 +0000 Subject: [PATCH] use "b" modes with STDC git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2013 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/ccache/stdio/scc_gennew.c | 4 ++++ src/lib/krb5/ccache/stdio/scc_maybe.c | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/lib/krb5/ccache/stdio/scc_gennew.c b/src/lib/krb5/ccache/stdio/scc_gennew.c index 950bb9a89..89906cf94 100644 --- a/src/lib/krb5/ccache/stdio/scc_gennew.c +++ b/src/lib/krb5/ccache/stdio/scc_gennew.c @@ -82,7 +82,11 @@ krb5_scc_generate_new (id) strcpy(((krb5_scc_data *) lid->data)->filename, scratch); /* Make sure the file name is useable */ +#if defined(__STDC__) + f = fopen (((krb5_scc_data *) lid->data)->filename, "wb+"); +#else f = fopen (((krb5_scc_data *) lid->data)->filename, "w+"); +#endif if (!f) return krb5_scc_interpret (errno); else { diff --git a/src/lib/krb5/ccache/stdio/scc_maybe.c b/src/lib/krb5/ccache/stdio/scc_maybe.c index 5347cf94b..d8bdecd48 100644 --- a/src/lib/krb5/ccache/stdio/scc_maybe.c +++ b/src/lib/krb5/ccache/stdio/scc_maybe.c @@ -84,6 +84,20 @@ krb5_scc_open_file (id, mode) (void) fclose (data->file); data->file = 0; } +#if defined(__STDC__) + switch(mode) { + case SCC_OPEN_AND_ERASE: + open_flag = "wb+"; + break; + case SCC_OPEN_RDWR: + open_flag = "rb+"; + break; + case SCC_OPEN_RDONLY: + default: + open_flag = "rb"; + break; + } +#else switch(mode) { case SCC_OPEN_AND_ERASE: open_flag = "w+"; @@ -96,6 +110,7 @@ krb5_scc_open_file (id, mode) open_flag = "r"; break; } +#endif f = fopen (data->filename, open_flag); if (!f) -- 2.26.2