Use ANSI stdio features iff ANSI_STDIO defined
authorJohn Carr <jfc@mit.edu>
Sat, 29 Feb 1992 20:19:38 +0000 (20:19 +0000)
committerJohn Carr <jfc@mit.edu>
Sat, 29 Feb 1992 20:19:38 +0000 (20:19 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2252 dc483132-0cff-0310-8789-dd5450dbe970

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

index c634b9334c02505b2538ce845c7648d51d66aac8..b2a6eaadb8ca81d75bb6a6aafe4a3c185c660f16 100644 (file)
@@ -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;