diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/date.c | 2 | ||||
-rw-r--r-- | src/expr.c | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/date.c b/src/date.c index 08998b2e1..b6159f209 100644 --- a/src/date.c +++ b/src/date.c @@ -64,7 +64,6 @@ #endif #ifndef STDC_HEADERS -time_t mktime (); size_t strftime (); time_t time (); #endif @@ -269,6 +268,7 @@ FORMAT controls the output. Interpreted sequences are:\n\ %%n a newline\n\ %%p locale's AM or PM\n\ %%r time, 12-hour (hh:mm:ss [AP]M)\n\ + %%s seconds since 00:00:00, Jan 1, 1970 (a nonstandard extension)\n\ %%t a horizontal tab\n\ %%w day of week (0..6)\n\ %%x locale's date representation (mm/dd/yy)\n\ diff --git a/src/expr.c b/src/expr.c index e5549140f..a3d42ff4c 100644 --- a/src/expr.c +++ b/src/expr.c @@ -316,6 +316,9 @@ toarith (v) case string: i = 0; cp = v->u.s; + /* Don't interpret the empty string as an integer. */ + if (*cp == 0) + return 0; neg = (*cp == '-'); if (neg) cp++; |