src/utils.c: Mark input string of parse_date() const
We don't mess about with the date string here, so it should be declared const. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
parent
59e006e56d
commit
162c6aebdd
@ -894,7 +894,7 @@ long mystrtol (const char *);
|
||||
void print_bool_option_incolor (WINDOW *, unsigned, int, int);
|
||||
const char *get_tempdir (void);
|
||||
char *new_tempfile (const char *, int);
|
||||
int parse_date (char *, enum datefmt, int *, int *, int *,
|
||||
int parse_date (const char *, enum datefmt, int *, int *, int *,
|
||||
struct date *);
|
||||
void str_toupper (char *);
|
||||
void file_close (FILE *, const char *);
|
||||
|
@ -608,11 +608,11 @@ new_tempfile (const char *prefix, int trailing_len)
|
||||
* Returns 1 if sucessfully converted or 0 if the string is an invalid date.
|
||||
*/
|
||||
int
|
||||
parse_date (char *date_string, enum datefmt datefmt, int *year, int *month,
|
||||
int *day, struct date *slctd_date)
|
||||
parse_date (const char *date_string, enum datefmt datefmt, int *year,
|
||||
int *month, int *day, struct date *slctd_date)
|
||||
{
|
||||
char sep = (datefmt == DATEFMT_ISO) ? '-' : '/';
|
||||
char *p;
|
||||
const char sep = (datefmt == DATEFMT_ISO) ? '-' : '/';
|
||||
const char *p;
|
||||
int in[3] = {0, 0, 0}, n = 0;
|
||||
int d, m, y;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user