if (!strncmp (SSDATA (name), " ", 1)) /* see bug#1229 */
{
/* Note fileio.c:make_temp_name does random differently. */
- sprintf (number, "-%"pI"d", XFASTINT (Frandom (make_number (999999))));
- tem2 = concat2 (name, build_string (number));
+ tem2 = concat2 (name, make_formatted_string
+ (number, "-%"pI"d",
+ XFASTINT (Frandom (make_number (999999)))));
tem = Fget_buffer (tem2);
if (NILP (tem))
return tem2;
count = 1;
while (1)
{
- sprintf (number, "<%"pD"d>", ++count);
- gentemp = concat2 (tem2, build_string (number));
+ gentemp = concat2 (tem2, make_formatted_string
+ (number, "<%"pD"d>", ++count));
tem = Fstring_equal (gentemp, ignore);
if (!NILP (tem))
return gentemp;
/* Must do these before making the first buffer! */
/* real setup is done in bindings.el */
- BVAR (&buffer_defaults, mode_line_format) = make_pure_c_string ("%-");
+ BVAR (&buffer_defaults, mode_line_format) = build_pure_c_string ("%-");
BVAR (&buffer_defaults, header_line_format) = Qnil;
BVAR (&buffer_defaults, abbrev_mode) = Qnil;
BVAR (&buffer_defaults, overwrite_mode) = Qnil;
current_buffer = 0;
all_buffers = 0;
- QSFundamental = make_pure_c_string ("Fundamental");
+ QSFundamental = build_pure_c_string ("Fundamental");
Qfundamental_mode = intern_c_string ("fundamental-mode");
BVAR (&buffer_defaults, major_mode) = Qfundamental_mode;
Fput (Qkill_buffer_hook, Qpermanent_local, Qt);
/* super-magic invisible buffer */
- Vprin1_to_string_buffer = Fget_buffer_create (make_pure_c_string (" prin1"));
+ Vprin1_to_string_buffer = Fget_buffer_create (build_pure_c_string (" prin1"));
Vbuffer_alist = Qnil;
- Fset_buffer (Fget_buffer_create (make_pure_c_string ("*scratch*")));
+ Fset_buffer (Fget_buffer_create (build_pure_c_string ("*scratch*")));
inhibit_modification_hooks = 0;
}
fatal ("`get_current_dir_name' failed: %s\n", strerror (errno));
pwd[len] = DIRECTORY_SEP;
pwd[len + 1] = '\0';
+ len++;
}
- BVAR (current_buffer, directory) = make_unibyte_string (pwd, strlen (pwd));
+ BVAR (current_buffer, directory) = make_unibyte_string (pwd, len);
if (! NILP (BVAR (&buffer_defaults, enable_multibyte_characters)))
/* At this moment, we still don't know how to decode the
directory name. So, we keep the bytes in multibyte form so
Fput (Qprotected_field, Qerror_conditions,
pure_cons (Qprotected_field, pure_cons (Qerror, Qnil)));
Fput (Qprotected_field, Qerror_message,
- make_pure_c_string ("Attempt to modify a protected field"));
+ build_pure_c_string ("Attempt to modify a protected field"));
DEFVAR_BUFFER_DEFAULTS ("default-mode-line-format",
mode_line_format,