From: Ken Raeburn Date: Wed, 6 Aug 2008 16:43:04 +0000 (+0000) Subject: Don't coerce fgetc value to char before EOF check X-Git-Tag: krb5-1.7-alpha1~528 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f1d1a653aaf1a9acde37b3d4e300e22566b41602;p=krb5.git Don't coerce fgetc value to char before EOF check git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20616 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/kadm5/srv/server_acl.c b/src/lib/kadm5/srv/server_acl.c index 6cc9492c3..8eed476c8 100644 --- a/src/lib/kadm5/srv/server_acl.c +++ b/src/lib/kadm5/srv/server_acl.c @@ -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 */