Fixed pitdate selection and query date configuration

This commit is contained in:
Deon George
2013-11-11 13:49:46 +11:00
parent 30b3eb1937
commit 16d53ae072
2 changed files with 23 additions and 5 deletions

View File

@@ -34,10 +34,16 @@ dsmDate dsmStrToDate(char *s) {
if (verbose)
printf("dsmStrToDate: Date String: %s\n", s);
/* if user key in some inputs */
if (s[0] != '\0') {
strncpy(x,s,sizeof(strchr(s,':')));
y=strchr(s,':');
if (y != NULL) {
strncpy(x,s,strlen(s)-strlen(y));
x[strlen(s)-strlen(y)] = '\0';
y = strchr(s,':')+1;
} else
x = s;
d = atol(x);
date->month = d / 1000000;
@@ -46,8 +52,7 @@ dsmDate dsmStrToDate(char *s) {
date->day = d / 10000;
date->year = d % 10000;
if (strlen(x) != strlen(s)) {
y = strchr(s,':')+1;
if (y != NULL) {
t = atol(y);
date->hour = t / 10000;