fixed some bugs/unproper code
This commit is contained in:
6
logger.c
6
logger.c
@@ -145,9 +145,6 @@ int LoggerWrite(Logger *log, time_t now, int period, char *value) {
|
||||
*/
|
||||
strftime(stim, sizeof stim,"%H:%M:%S", tm);
|
||||
fprintf(fil, "%s\t%s%s\n", stim, value, buf);
|
||||
// if (0 != strncmp(value, log->old, sizeof(log->old)) || buf[0]!='\0') { /* value has changed */
|
||||
// log->pos = ftell(fil); /* next time append to the end */
|
||||
// }
|
||||
l = strlen(value);
|
||||
if (l >= sizeof(log->old)) {
|
||||
l = sizeof(log->old) - 1;
|
||||
@@ -324,6 +321,7 @@ static void LoggerPut(Compressor *c, time_t t, char *value) {
|
||||
int LoggerGraph(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
int argc, char *argv[]) {
|
||||
time_t from, to, step, xs, lastt, now;
|
||||
long lxs;
|
||||
char *p;
|
||||
int i, l, yday, iret, loss;
|
||||
int inRange;
|
||||
@@ -431,7 +429,7 @@ int LoggerGraph(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
if (p) {
|
||||
stp = p+1;
|
||||
*p='\0';
|
||||
iret = sscanf(stp, "%ld", &xs);
|
||||
iret = sscanf(stp, "%ld", &lxs); xs = lxs;
|
||||
if (iret == 1) {
|
||||
if (xs < step) {
|
||||
loss = 1;
|
||||
|
||||
Reference in New Issue
Block a user