X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=date.c;h=102d688afc86e1d8791a191ce5b5eed558194f5c;hp=0f217e44134b5567cbf401b32c7fdf0a48fd3d93;hb=c777524834a805476d0dce81b42342dca4702893;hpb=f638fbf8d6c5c3dada648edf974a410c3ca7ace5 diff --git a/date.c b/date.c index 0f217e44..102d688a 100644 --- a/date.c +++ b/date.c @@ -75,7 +75,7 @@ static unsigned char gmime_datetok_table[256] = { 111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, }; -/* hrm, is there a library for this shit? */ +/* hrm, is there a library for this stuff? */ static struct { char *name; int offset; @@ -222,8 +222,9 @@ static int get_wday (const char *in, size_t inlen) { int wday; - - g_return_val_if_fail (in != NULL, -1); + + if (in == NULL) + return -1; if (inlen < 3) return -1; @@ -241,7 +242,8 @@ get_mday (const char *in, size_t inlen) { int mday; - g_return_val_if_fail (in != NULL, -1); + if (in == NULL) + return -1; mday = decode_int (in, inlen); @@ -256,7 +258,8 @@ get_month (const char *in, size_t inlen) { int i; - g_return_val_if_fail (in != NULL, -1); + if (in == NULL) + return -1; if (inlen < 3) return -1; @@ -274,7 +277,8 @@ get_year (const char *in, size_t inlen) { int year; - g_return_val_if_fail (in != NULL, -1); + if (in == NULL) + return -1; if ((year = decode_int (in, inlen)) == -1) return -1; @@ -288,7 +292,7 @@ get_year (const char *in, size_t inlen) return year; } -static gboolean +static int get_time (const char *in, size_t inlen, int *hour, int *min, int *sec) { register const char *inptr; @@ -405,7 +409,8 @@ parse_rfc822_date (date_token *tokens, int *tzone) struct tm tm; time_t t; - g_return_val_if_fail (tokens != NULL, (time_t) 0); + if (tokens == NULL) + return 0; token = tokens; @@ -481,7 +486,7 @@ parse_rfc822_date (date_token *tokens, int *tzone) static time_t parse_broken_date (date_token *tokens, int *tzone) { - gboolean got_wday, got_month, got_tzone; + int got_wday, got_month, got_tzone; int hour, min, sec, offset, n; date_token *token; struct tm tm;