diff options
Diffstat (limited to 'src/frame.c')
| -rw-r--r-- | src/frame.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/frame.c b/src/frame.c index 5cbdcf15abf..e663538a840 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -23,6 +23,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 23 | 23 | ||
| 24 | #include <stdio.h> | 24 | #include <stdio.h> |
| 25 | #include <ctype.h> | 25 | #include <ctype.h> |
| 26 | #include <errno.h> | ||
| 27 | #include <limits.h> | ||
| 26 | #include <setjmp.h> | 28 | #include <setjmp.h> |
| 27 | #include "lisp.h" | 29 | #include "lisp.h" |
| 28 | #include "character.h" | 30 | #include "character.h" |
| @@ -2149,10 +2151,13 @@ frame_name_fnn_p (char *str, EMACS_INT len) | |||
| 2149 | if (len > 1 && str[0] == 'F') | 2151 | if (len > 1 && str[0] == 'F') |
| 2150 | { | 2152 | { |
| 2151 | char *end_ptr; | 2153 | char *end_ptr; |
| 2154 | long int n; | ||
| 2155 | errno = 0; | ||
| 2156 | n = strtol (str + 1, &end_ptr, 10); | ||
| 2152 | 2157 | ||
| 2153 | strtol (str + 1, &end_ptr, 10); | 2158 | if (end_ptr == str + len |
| 2154 | 2159 | && INT_MIN <= n && n <= INT_MAX | |
| 2155 | if (end_ptr == str + len) | 2160 | && ((LONG_MIN < n && n < LONG_MAX) || errno != ERANGE)) |
| 2156 | return 1; | 2161 | return 1; |
| 2157 | } | 2162 | } |
| 2158 | return 0; | 2163 | return 0; |