"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/misc.c" between
vnstat-2.8.tar.gz and vnstat-2.9.tar.gz

About: vnStat is a console-based network traffic monitor (using the /proc filesystem).

misc.c  (vnstat-2.8):misc.c  (vnstat-2.9)
skipping to change at line 364 skipping to change at line 364
} }
/* validity of date or time itself isn't checked here as sqlite handles that */ /* validity of date or time itself isn't checked here as sqlite handles that */
int validatedatetime(const char *str) int validatedatetime(const char *str)
{ {
short valid; short valid;
unsigned int len, i, t; unsigned int len, i, t;
const char *templates[] = {"dddd-dd-dd dd:dd", "dddd-dd-dd"}; const char *templates[] = {"dddd-dd-dd dd:dd", "dddd-dd-dd"};
len = (unsigned int)strlen(str); len = (unsigned int)strlen(str);
if (strcmp(str, "today") == 0) {
return 1;
}
if (len > strlen(templates[0])) { if (len > strlen(templates[0])) {
return 0; return 0;
} }
for (t = 0; t < 2; t++) { for (t = 0; t < 2; t++) {
if (len != strlen(templates[t])) { if (len != strlen(templates[t])) {
continue; continue;
} }
valid = 1; valid = 1;
for (i = 0; i < strlen(templates[t]); i++) { for (i = 0; i < strlen(templates[t]); i++) {
 End of changes. 1 change blocks. 
0 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)