* `LICENSE' that comes with the fcron source distribution.
*/
- /* $Id: conf.c,v 1.29 2000-11-10 17:36:26 thib Exp $ */
+ /* $Id: conf.c,v 1.30 2000-11-13 15:47:50 thib Exp $ */
#include "fcron.h"
}
/* get the owner's name */
- user = read_str(ff, buf, sizeof(buf));
-
+ if ( (user = read_str(ff, buf, sizeof(buf))) == NULL ) {
+ error("Cannot read user's name : file ignored");
+ return 1;
+ }
/* get the time & date of the saving */
/* a new file generated by fcrontab has t_save set to 0 */
Alloc(cl, CL);
while ( fread(cl, sizeof(CL), 1, ff) == 1 ) {
- cl->cl_shell = read_str(ff, buf, sizeof(buf));
+ if ((cl->cl_shell = read_str(ff, buf, sizeof(buf))) == NULL) {
+ error("Line is not valid (empty shell command) : ignored");
+ continue;
+ }
if ( is_td(cl->cl_option) ) {
}
- /* then, write the number of lines to permit to check if the file
- * is complete (i.e. fcron may has been interrupted during
- * save process */
-/* // fprintf(f, "eof\n"); */
-
fclose(f);
if (file != NULL)