use "b" modes with STDC
authorJohn Kohl <jtkohl@mit.edu>
Fri, 19 Apr 1991 14:54:05 +0000 (14:54 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Fri, 19 Apr 1991 14:54:05 +0000 (14:54 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2013 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/ccache/stdio/scc_gennew.c
src/lib/krb5/ccache/stdio/scc_maybe.c

index 950bb9a8986cd647f562bf54610ae6843439e096..89906cf943f2ae9792a0945b2126b0c689faade9 100644 (file)
@@ -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 {
index 5347cf94beb1a667b24dc28fb4d0f3f90c037224..d8bdecd48c6dbe2577c90d5d9ca2e80d7ddcb1fa 100644 (file)
@@ -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)