Commit 2b753167 authored by Tatsuhiko Kubo's avatar Tatsuhiko Kubo

Use sizeof() instead of strlen().

parent 465ce1e5
......@@ -45,7 +45,7 @@ build_path(mrb_state *mrb, const char *dir, const char *base)
len = strlen(base) + 1;
if (strcmp(dir, ".")) {
len += strlen(dir) + strlen("/");
len += strlen(dir) + sizeof("/") - 1;
}
path = mrb_malloc(mrb, len);
......
......@@ -275,7 +275,7 @@ get_command(mrb_state *mrb, mrdb_state *mrdb)
if (i == 0 && feof(stdin)) {
clearerr(stdin);
strcpy(mrdb->command, "quit");
i += strlen("quit");
i += sizeof("quit") - 1;
}
if (i == MAX_COMMAND_LINE) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment