diff options
| author | Paul Eggert | 2011-09-04 16:58:01 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-09-04 16:58:01 -0700 |
| commit | 1c262cae409ec55a234c89b3b74a13a77c7f595a (patch) | |
| tree | 2780610d6227a3b1f64aa9398f21501ce3de774e /src/editfns.c | |
| parent | 7f59d9c856de33b97bc3f2708dcc8dadf24ee040 (diff) | |
| parent | 052bd38a56ad14a7f311677051e778de6c4bdc1c (diff) | |
| download | emacs-1c262cae409ec55a234c89b3b74a13a77c7f595a.tar.gz emacs-1c262cae409ec55a234c89b3b74a13a77c7f595a.zip | |
Merge from trunk.
Diffstat (limited to 'src/editfns.c')
| -rw-r--r-- | src/editfns.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/editfns.c b/src/editfns.c index 6759016766f..580298c6e7d 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -2014,7 +2014,7 @@ the data it can't find. */) | |||
| 2014 | { | 2014 | { |
| 2015 | int offset = tm_diff (t, &gmt); | 2015 | int offset = tm_diff (t, &gmt); |
| 2016 | char *s = 0; | 2016 | char *s = 0; |
| 2017 | char buf[6]; | 2017 | char buf[sizeof "+00" + INT_STRLEN_BOUND (int)]; |
| 2018 | 2018 | ||
| 2019 | #ifdef HAVE_TM_ZONE | 2019 | #ifdef HAVE_TM_ZONE |
| 2020 | if (t->tm_zone) | 2020 | if (t->tm_zone) |
| @@ -2029,7 +2029,8 @@ the data it can't find. */) | |||
| 2029 | if (!s) | 2029 | if (!s) |
| 2030 | { | 2030 | { |
| 2031 | /* No local time zone name is available; use "+-NNNN" instead. */ | 2031 | /* No local time zone name is available; use "+-NNNN" instead. */ |
| 2032 | int am = (offset < 0 ? -offset : offset) / 60; | 2032 | int m = offset / 60; |
| 2033 | int am = offset < 0 ? - m : m; | ||
| 2033 | sprintf (buf, "%c%02d%02d", (offset < 0 ? '-' : '+'), am/60, am%60); | 2034 | sprintf (buf, "%c%02d%02d", (offset < 0 ? '-' : '+'), am/60, am%60); |
| 2034 | s = buf; | 2035 | s = buf; |
| 2035 | } | 2036 | } |