diff options
| -rw-r--r-- | src/editfns.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/editfns.c b/src/editfns.c index 9c88d963eb3..800aef9f7c8 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -194,15 +194,13 @@ A multibyte character is handled correctly. */) | |||
| 194 | register Lisp_Object string; | 194 | register Lisp_Object string; |
| 195 | { | 195 | { |
| 196 | register Lisp_Object val; | 196 | register Lisp_Object val; |
| 197 | register struct Lisp_String *p; | ||
| 198 | CHECK_STRING (string); | 197 | CHECK_STRING (string); |
| 199 | p = XSTRING (string); | 198 | if (SCHARS (string)) |
| 200 | if (p->size) | ||
| 201 | { | 199 | { |
| 202 | if (STRING_MULTIBYTE (string)) | 200 | if (STRING_MULTIBYTE (string)) |
| 203 | XSETFASTINT (val, STRING_CHAR (p->data, STRING_BYTES (p))); | 201 | XSETFASTINT (val, STRING_CHAR (SDATA (string), SBYTES (string))); |
| 204 | else | 202 | else |
| 205 | XSETFASTINT (val, p->data[0]); | 203 | XSETFASTINT (val, SREF (string, 0)); |
| 206 | } | 204 | } |
| 207 | else | 205 | else |
| 208 | XSETFASTINT (val, 0); | 206 | XSETFASTINT (val, 0); |