diff --git a/json_messages.c b/json_messages.c index b7edf60..4f7e3a2 100644 --- a/json_messages.c +++ b/json_messages.c @@ -39,7 +39,7 @@ int build_sprinkler_cal_JSON(char* buffer, int size) for (day=0; day <= 6; day++) { if (_sdconfig_.cron[day].hour >= 0 && _sdconfig_.cron[day].minute >= 0) { length += sprintf(buffer+length, ", \"d%d-starttime\" : \"%.2d:%.2d\" ",day,_sdconfig_.cron[day].hour,_sdconfig_.cron[day].minute); - for (zone=1; zone < _sdconfig_.zones; zone ++) { + for (zone=0; zone < _sdconfig_.zones; zone ++) { if (_sdconfig_.cron[day].zruntimes[zone] >= 0) { length += sprintf(buffer+length, ", \"d%dz%d-runtime\" : %d",day,zone+1,_sdconfig_.cron[day].zruntimes[zone]); //logMessage(LOG_DEBUG, "Zone %d, length %d limit %d\n",zone,length,size); diff --git a/release/sprinklerd b/release/sprinklerd index cc26783..2445e51 100755 Binary files a/release/sprinklerd and b/release/sprinklerd differ diff --git a/sd_cron.c b/sd_cron.c index 5ce06e8..8f1d421 100644 --- a/sd_cron.c +++ b/sd_cron.c @@ -153,7 +153,7 @@ void write_cron() { //length += sprintf(buffer+length, ", \"d%d-starttime\" : \"%.2d:%.2d\" ",day,_sdconfig_.cron[day].hour,_sdconfig_.cron[day].minute); min = _sdconfig_.cron[day].minute; hour = _sdconfig_.cron[day].hour; - for (zone=1; zone < _sdconfig_.zones; zone ++) { + for (zone=0; zone < _sdconfig_.zones; zone ++) { if (_sdconfig_.cron[day].zruntimes[zone] > 0) { fprintf(fp, "%d %d * * %d root /usr/bin/curl -s -o /dev/null 'localhost:%s?type=cron&zone=%d&runtime=%d&state=on'\n",min,hour,day,_sdconfig_.socket_port,zone+1,_sdconfig_.cron[day].zruntimes[zone]); //fprintf(fp, "%d %d * * %d root /usr/bin/curl -s -o /dev/null 'localhost?type=cron&zone=%d&runtime=%d&state=on'\n",min,hour,day,zone+1,_sdconfig_.cron[day].zruntimes[zone]); diff --git a/version.h b/version.h index 2bda58c..2e66468 100644 --- a/version.h +++ b/version.h @@ -1,6 +1,6 @@ #ifndef SD_VERSION_H #define SD_VERSION_H -#define SD_VERSION "1.1" +#define SD_VERSION "1.2" #endif