date handling: handle "AM"/"PM" on time
And be a bitmore careful about matching: if we don't recognize a word or a number, we skip the whole thing, rather than trying the next character in that word/number. Finally: since ctime() adds the final '\n', don't add another one in test-date.
This commit is contained in:
@ -14,7 +14,7 @@ int main(int argc, char **argv)
|
||||
memcpy(result, "bad", 4);
|
||||
parse_date(argv[i], result, sizeof(result));
|
||||
t = strtoul(result, NULL, 0);
|
||||
printf("%s -> %s -> %s\n", argv[i], result, ctime(&t));
|
||||
printf("%s -> %s -> %s", argv[i], result, ctime(&t));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user