@@ -258,7 +258,9 @@ int build_schedules_js(char* buffer, int size)
258
258
// Group 9 is URL
259
259
// Group 10 is value
260
260
if (groupArray [8 ].rm_so == (size_t )-1 ) {
261
- LOG (SCHD_LOG ,LOG_ERR , "No matching information from cron file\n" );
261
+ if (size > 0 ) {
262
+ LOG (SCHD_LOG ,LOG_ERR , "No matching information from cron file\n" );
263
+ }
262
264
} else {
263
265
cline .enabled = (line [groupArray [1 ].rm_so ] == '#' )?false:true;
264
266
sprintf (cline .minute , "%.*s" , (groupArray [2 ].rm_eo - groupArray [2 ].rm_so ), (line + groupArray [2 ].rm_so ));
@@ -268,8 +270,8 @@ int build_schedules_js(char* buffer, int size)
268
270
sprintf (cline .dayw , "%.*s" , (groupArray [6 ].rm_eo - groupArray [6 ].rm_so ), (line + groupArray [6 ].rm_so ));
269
271
sprintf (cline .url , "%.*s" , (groupArray [9 ].rm_eo - groupArray [9 ].rm_so ), (line + groupArray [9 ].rm_so ));
270
272
sprintf (cline .value , "%.*s" , (groupArray [10 ].rm_eo - groupArray [10 ].rm_so ), (line + groupArray [10 ].rm_so ));
271
- LOG (SCHD_LOG ,LOG_INFO , "Read from cron. Enabled:%d Min:%s Hour:%s DayM:%s Month:%s DayW:%s URL:%s Value:%s\n" ,cline .enabled ,cline .minute ,cline .hour ,cline .daym ,cline .month ,cline .dayw ,cline .url ,cline .value );
272
273
if (size > 0 ) {
274
+ LOG (SCHD_LOG ,LOG_INFO , "Read from cron. Enabled:%d Min:%s Hour:%s DayM:%s Month:%s DayW:%s URL:%s Value:%s\n" ,cline .enabled ,cline .minute ,cline .hour ,cline .daym ,cline .month ,cline .dayw ,cline .url ,cline .value );
273
275
length += sprintf (buffer + length , "{\"enabled\":\"%d\", \"min\":\"%s\",\"hour\":\"%s\",\"daym\":\"%s\",\"month\":\"%s\",\"dayw\":\"%s\",\"url\":\"%s\",\"value\":\"%s\"}," ,
274
276
cline .enabled ,
275
277
cline .minute ,
@@ -300,7 +302,9 @@ int build_schedules_js(char* buffer, int size)
300
302
}
301
303
}
302
304
} else {
303
- LOG (SCHD_LOG ,LOG_DEBUG , "regexp no match (%d) %s\n" , rc , line );
305
+ if (size > 0 ) {
306
+ LOG (SCHD_LOG ,LOG_DEBUG , "regexp no match (%d) %s" , rc , line );
307
+ }
304
308
}
305
309
}
306
310
0 commit comments