Don't coerce fgetc value to char before EOF check
authorKen Raeburn <raeburn@mit.edu>
Wed, 6 Aug 2008 16:43:04 +0000 (16:43 +0000)
committerKen Raeburn <raeburn@mit.edu>
Wed, 6 Aug 2008 16:43:04 +0000 (16:43 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20616 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/kadm5/srv/server_acl.c

index 6cc9492c372109976cda1503cd88cd5d233b4362..8eed476c8b4347152f860bbee7ea348a28714e67 100644 (file)
@@ -115,8 +115,10 @@ kadm5int_acl_get_line(fp, lnp)
     for (domore = 1; domore && !feof(fp); ) {
        /* Copy in the line, with continuations */
        for (i=0; ((i < sizeof acl_buf) && !feof(fp)); i++ ) {
-           acl_buf[i] = fgetc(fp);
-           if (acl_buf[i] == (char)EOF) {
+           int byte;
+           byte = fgetc(fp);
+           acl_buf[i] = byte;
+           if (byte == (char)EOF) {
                if (i > 0 && acl_buf[i-1] == '\\')
                    i--;
                break;          /* it gets nulled-out below */