* `LICENSE' that comes with the fcron source distribution.
*/
- /* $Id: fileconf.c,v 1.53 2001-10-29 13:22:10 thib Exp $ */
+ /* $Id: fileconf.c,v 1.54 2001-12-23 12:20:46 thib Exp $ */
#include "fcrontab.h"
{
size_t size_max = size - 1 ;
register int i=0;
+ int c;
while (i < size_max ) {
- switch ( *(str + i) = getc(file) ) {
+ switch ( c = getc(file) ) {
case '\n':
/* check if the \n char is preceded by a "\" char :
continue;
}
else {
- *(str + i) = '\0';
+ *(str + i) = (char) '\0';
return OK;
}
break;
case EOF:
- *(str + i) = '\0';
+ *(str + i) = (char) '\0';
/* we couldn't return EOF ( equal to ERR by default )
* nor ERR, which is used for another error */
return 999;
default:
+ *(str + i) = (char) c;
i++;
}
}
/* line is too long : goto next line and return ERR */
- while ((*str = getc(file)) != '\n' && ( *str != (char) EOF ) )
+ while ( ((c = getc(file)) != EOF ) && (c != (int) '\n') )
;
line++;
need_correction = 1;