On platforms where the char type is unsigned, the check for EOF (which
is negative) will always fail, leaving a 255 byte at the end of the
line. This can cause a syntax error, in turn causing the contents of
kadm5.acl to be ignored. Fix this bug by removing the cast on EOF.
[ghudson@mit.edu: more precisely describe consequences of bug in
commit message]
ticket: 8346 (new)
target_version: 1.14-next
target_version: 1.13-next
tags: pullup
int byte;
byte = fgetc(fp);
acl_buf[i] = byte;
- if (byte == (char)EOF) {
+ if (byte == EOF) {
if (i > 0 && acl_buf[i-1] == '\\')
i--;
break; /* it gets nulled-out below */