fixing some cc warnings

This commit is contained in:
Alex Shinn 2020-07-24 15:35:31 +09:00
parent 0b9332ba77
commit ea370db4b4
2 changed files with 3 additions and 3 deletions

4
eval.c
View file

@ -2425,9 +2425,9 @@ sexp sexp_load_standard_env (sexp ctx, sexp e, sexp version) {
= sexp_env_ref(ctx, e, sym=sexp_intern(ctx, "current-exception-handler", -1), SEXP_FALSE);
/* load init-7.scm */
len = strlen(sexp_init_file);
strncpy(init_file, sexp_init_file, len);
strncpy(init_file, sexp_init_file, len+1);
init_file[len] = (char)sexp_unbox_fixnum(version) + '0';
strncpy(init_file + len + 1, sexp_init_file_suffix, strlen(sexp_init_file_suffix));
strncpy(init_file + len + 1, sexp_init_file_suffix, strlen(sexp_init_file_suffix)+1);
init_file[len + 1 + strlen(sexp_init_file_suffix)] = 0;
tmp = sexp_load_module_file(ctx, init_file, e);
sexp_set_parameter(ctx, e, sexp_global(ctx, SEXP_G_INTERACTION_ENV_SYMBOL), e);

View file

@ -338,7 +338,7 @@ sexp json_write_flonum(sexp ctx, sexp self, const sexp obj, sexp out) {
sexp json_write_string(sexp ctx, sexp self, const sexp obj, sexp out) {
char cout[32]; /* oversized to avoid snprintf warnings */
sexp_sint_t ch, chh, chl;
sexp_uint_t ch, chh, chl;
sexp i, end = sexp_make_string_cursor(sexp_string_size(obj));
sexp_write_char(ctx, '"', out);