diff options
| author | Paul Eggert | 2016-04-04 17:04:58 -0700 |
|---|---|---|
| committer | Paul Eggert | 2016-04-04 17:05:19 -0700 |
| commit | b4c7869e5e1bb0bb33379b25ff830e721761a7bf (patch) | |
| tree | 07b81f9711ea7188421c2ac2303b442778b6c980 /src/filelock.c | |
| parent | 3c623c26ae7d695746e05d8a2e16a67a6256b024 (diff) | |
| download | emacs-b4c7869e5e1bb0bb33379b25ff830e721761a7bf.tar.gz emacs-b4c7869e5e1bb0bb33379b25ff830e721761a7bf.zip | |
Prefer AUTO_STRING_WITH_LEN to make_formatted_string
* src/buffer.c (Fgenerate_new_buffer_name):
* src/filelock.c (get_boot_time):
* src/minibuf.c (get_minibuffer):
* src/process.c (make_process):
* src/xdisp.c (ensure_echo_area_buffers):
Prefer AUTO_STRING_WITH_LEN + sprintf to make_formatted_string
when either will do.
Diffstat (limited to 'src/filelock.c')
| -rw-r--r-- | src/filelock.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/filelock.c b/src/filelock.c index 4c5d72ddb95..c58484a639b 100644 --- a/src/filelock.c +++ b/src/filelock.c | |||
| @@ -191,14 +191,11 @@ get_boot_time (void) | |||
| 191 | /* If we did not find a boot time in wtmp, look at wtmp, and so on. */ | 191 | /* If we did not find a boot time in wtmp, look at wtmp, and so on. */ |
| 192 | for (counter = 0; counter < 20 && ! boot_time; counter++) | 192 | for (counter = 0; counter < 20 && ! boot_time; counter++) |
| 193 | { | 193 | { |
| 194 | Lisp_Object filename = Qnil; | ||
| 195 | bool delete_flag = false; | ||
| 194 | char cmd_string[sizeof WTMP_FILE ".19.gz"]; | 196 | char cmd_string[sizeof WTMP_FILE ".19.gz"]; |
| 195 | Lisp_Object tempname, filename; | 197 | AUTO_STRING_WITH_LEN (tempname, cmd_string, |
| 196 | bool delete_flag = 0; | 198 | sprintf (cmd_string, "%s.%d", WTMP_FILE, counter)); |
| 197 | |||
| 198 | filename = Qnil; | ||
| 199 | |||
| 200 | tempname = make_formatted_string | ||
| 201 | (cmd_string, "%s.%d", WTMP_FILE, counter); | ||
| 202 | if (! NILP (Ffile_exists_p (tempname))) | 199 | if (! NILP (Ffile_exists_p (tempname))) |
| 203 | filename = tempname; | 200 | filename = tempname; |
| 204 | else | 201 | else |
| @@ -218,7 +215,7 @@ get_boot_time (void) | |||
| 218 | CALLN (Fcall_process, build_string ("gzip"), Qnil, | 215 | CALLN (Fcall_process, build_string ("gzip"), Qnil, |
| 219 | list2 (QCfile, filename), Qnil, | 216 | list2 (QCfile, filename), Qnil, |
| 220 | build_string ("-cd"), tempname); | 217 | build_string ("-cd"), tempname); |
| 221 | delete_flag = 1; | 218 | delete_flag = true; |
| 222 | } | 219 | } |
| 223 | } | 220 | } |
| 224 | 221 | ||